Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .jscpd.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"packages/components/src/components/**/*.spec.tsx",
"packages/components/src/components/tag/tag.spec.tsx",
"**/**config.ts",
"**/navigation-items.ts",
"packages/foundations/assets/icons/functional/fonts/sources/*.json"
],
"absolute": true
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions build-power-apps/DBUI/DBUI.cdsproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\sub-navigation\DBSubNavigation.pcfproj" />

<ProjectReference Include="..\main-navigation\DBMainNavigation.pcfproj" />

<ProjectReference Include="..\button\DBButton.pcfproj" />
<ProjectReference Include="..\icon\DBIcon.pcfproj" />
<ProjectReference Include="..\input\DBInput.pcfproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { DBMainNavigation, DBMainNavigationModule } from './main-navigation';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { DBNavigationItem, DBNavigationItemModule } from './navigation-item';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { DBSubNavigation, DBSubNavigationModule } from './sub-navigation';
30 changes: 8 additions & 22 deletions packages/components/scripts/post-build/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
* }]}
*/
const getComponents = () => [
{
name: 'main-navigation'
},

{
name: 'navigation-item'
},

{
name: 'select'
},
Expand All @@ -29,12 +37,6 @@ const getComponents = () => [
to: 'const dialogRef = useRef<HTMLDialogElement>(component);'
}
],
vue: [
{
from: 'immediate: true,',
to: 'immediate: true,\nflush: "post"'
}
],
webComponents: [{ from: '__prev.find', to: '!!__prev.find' }]
}
},
Expand All @@ -48,14 +50,6 @@ const getComponents = () => [

{
name: 'checkbox',
overwrites: {
vue: [
{
from: 'immediate: true,',
to: 'immediate: true,\nflush: "post"'
}
]
},
config: {
vue: {
vModel: [{ modelValue: 'checked', binding: ':checked' }]
Expand All @@ -68,14 +62,6 @@ const getComponents = () => [

{
name: 'radio',
overwrites: {
vue: [
{
from: 'immediate: true,',
to: 'immediate: true,\nflush: "post"'
}
]
},
config: {
vue: {
vModel: [{ modelValue: 'checked', binding: ':checked' }]
Expand Down
8 changes: 8 additions & 0 deletions packages/components/scripts/post-build/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ module.exports = (tmp) => {
{
from: `checked={props.checked}`,
to: `defaultChecked={props.checked}`
},
{
from: 'if (ref.current)',
to: 'if (ref?.current)'
},
{
from: '[ref.current]',
to: '[ref]'
}
];

Expand Down
12 changes: 11 additions & 1 deletion packages/components/scripts/post-build/vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,17 @@ module.exports = (tmp) => {
});
}

runReplacements([], component, 'vue', vueFile);
runReplacements(
[
{
from: 'immediate: true,',
to: 'immediate: true,\nflush: "post"'
}
],
component,
'vue',
vueFile
);
} catch (error) {
console.error('Error occurred:', error);
}
Expand Down
11 changes: 4 additions & 7 deletions packages/components/src/components/button/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
GlobalProps,
GlobalState,
IconProps,
IconState
IconState,
WidthProps
} from '../../shared/model';

// TODO: 👇 Find a way to make react-docgen work without duplicating the types below
Expand Down Expand Up @@ -68,11 +69,6 @@ export type DBButtonDefaultProps = {
*/
size?: 'small';

/**
* Width of the button. Auto width based on text size, full width based on parent elements width.
*/
width?: 'full' | 'auto';

/**
* Variant of the button. Use only 1 primary button on a page as CTA otherwise use one of the adaptive buttons.
*/
Expand All @@ -82,7 +78,8 @@ export type DBButtonDefaultProps = {
export type DBButtonProps = DBButtonDefaultProps &
GlobalProps &
ClickEventProps &
IconProps;
IconProps &
WidthProps;

export type DBButtonDefaultState = {};

Expand Down
6 changes: 3 additions & 3 deletions packages/components/src/components/checkbox/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
FormProps,
FormState,
FormCheckProps,
FormCheckState
InitializedState
} from '../../shared/model';

export interface DBCheckboxDefaultProps {
Expand All @@ -35,12 +35,12 @@ export type DBCheckboxProps = DBCheckboxDefaultProps &
FormCheckProps;

export type DBCheckboxDefaultState = {
_indeterminate: boolean;
_indeterminate?: boolean;
};

export type DBCheckboxState = DBCheckboxDefaultState &
GlobalState &
ChangeEventState &
FocusEventState &
FormState &
FormCheckState;
InitializedState;
12 changes: 5 additions & 7 deletions packages/components/src/components/drawer/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {
CloseEventState,
GlobalProps,
GlobalState,
InnerCloseButtonProps
InnerCloseButtonProps,
WidthProps
} from '../../shared/model';

export interface DBDrawerDefaultProps {
Expand Down Expand Up @@ -34,11 +35,7 @@ export interface DBDrawerDefaultProps {
* React specific to change the header of the drawer.
*/
slotDrawerHeader?: any;
/**
* The width attribute disables the max-width of the drawer and overlays over the entire screen.
* Default max-width is: calc(100% - $db-spacing-fixed-xl), but you can overwrite it with --db-drawer-max-width.
*/
width?: 'full';

/**
* The withCloseButton attribute shows/hides the default close button.
*/
Expand All @@ -48,7 +45,8 @@ export interface DBDrawerDefaultProps {
export type DBDrawerProps = DBDrawerDefaultProps &
GlobalProps &
CloseEventProps &
InnerCloseButtonProps;
InnerCloseButtonProps &
WidthProps;

export interface DBDrawerDefaultState {
handleDialogOpen: () => void;
Expand Down
21 changes: 14 additions & 7 deletions packages/components/src/components/header/header.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@use "@db-ui/foundations/build/scss/variables" as *;
@use "@db-ui/foundations/build/scss/variables.global" as *;
@use "@db-ui/foundations/build/scss/helpers/functions" as *;
@use "@db-ui/foundations/build/scss/helpers/component" as *;
@use "@db-ui/foundations/build/scss/tonality" as *;

.db-header {
Expand All @@ -11,6 +12,8 @@
margin-bottom: $db-spacing-fixed-2xs;
position: relative;

min-height: $default-mobile-header-height;

.db-link {
display: inline-block;
}
Expand All @@ -24,6 +27,10 @@
gap: $db-spacing-fixed-xs;
width: 100%;
align-items: center;

@media screen and (min-width: $db-screens-m) {
padding: $db-spacing-fixed-md;
}
}

.db-header-meta-navigation {
Expand All @@ -37,7 +44,7 @@

padding: $db-spacing-fixed-md;

@media screen and (min-width: $db-screens-s) {
@media screen and (min-width: $db-screens-m) {
padding: $db-spacing-fixed-xs $db-spacing-fixed-md;
margin: 0;
flex-direction: row;
Expand Down Expand Up @@ -65,7 +72,7 @@
}

.db-header-action-container:has(> .db-header-action-bar:empty) {
@media screen and (min-width: $db-screens-s) {
@media screen and (min-width: $db-screens-m) {
display: none;
}
}
Expand All @@ -82,7 +89,7 @@
}

.db-header-action-bar {
@media screen and (max-width: $db-screens-s) {
@media screen and (max-width: $db-screens-m) {
@include divider("top");
flex: 0 1 auto;
flex-grow: 0;
Expand All @@ -92,7 +99,7 @@
}

.db-header-drawer-navigation {
@media screen and (max-width: $db-screens-s) {
@media screen and (max-width: $db-screens-m) {
display: flex;
flex-direction: column;
flex: 1 1 auto;
Expand All @@ -112,7 +119,7 @@
gap: $db-spacing-fixed-sm;
padding-inline: $db-spacing-fixed-md;

@media screen and (min-width: $db-screens-s) {
@media screen and (min-width: $db-screens-m) {
gap: $db-spacing-fixed-xs;
padding: 0;
}
Expand All @@ -133,13 +140,13 @@
}

.db-header-hide-on-mobile {
@media screen and (max-width: $db-screens-s) {
@media screen and (max-width: $db-screens-m) {
display: none;
}
}

.db-header-hide-on-desktop {
@media screen and (min-width: $db-screens-s) {
@media screen and (min-width: $db-screens-m) {
display: none;
}
}
5 changes: 3 additions & 2 deletions packages/components/src/components/input/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ import {
IconProps,
IconState,
DefaultVariantProps,
KeyValueType
KeyValueType,
IconAfterProps
} from '../../shared/model';

export type DBInputDefaultProps = {
dataList?: KeyValueType[];
dataListId?: string;
description?: string;
iconAfter?: string;
type?:
| 'text'
| 'search'
Expand All @@ -45,6 +45,7 @@ export type DBInputProps = DBInputDefaultProps &
ValidEventProps &
FormProps &
IconProps &
IconAfterProps &
DefaultVariantProps;

export type DBInputDefaultState = {
Expand Down
24 changes: 24 additions & 0 deletions packages/components/src/components/main-navigation/docs/Angular.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Angular

For general installation and configuration look at the [ngx-components](https://www.npmjs.com/package/@db-ui/ngx-components) package.

### Load component

```ts app.module.ts
//app.module.ts
import { DBMainNavigationModule } from '@db-ui/ngx-components';

@NgModule({
...
imports: [..., DBMainNavigationModule],
...
})

```

### Use component

```html app.component.html
<!-- app.component.html -->
<db-main-navigation>MainNavigation</db-main-navigation>
```
13 changes: 13 additions & 0 deletions packages/components/src/components/main-navigation/docs/HTML.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## HTML

For general installation and configuration look at the [components](https://www.npmjs.com/package/@db-ui/components) package.

### Use component

```html index.html
<!-- index.html -->
...
<body>
<div class="db-main-navigation">MainNavigation</div>
</body>
```
14 changes: 14 additions & 0 deletions packages/components/src/components/main-navigation/docs/React.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## React

For general installation and configuration look at the [react-components](https://www.npmjs.com/package/@db-ui/react-components) package.

### Use component

```tsx App.tsx
// App.tsx
import { DBMainNavigation } from "@db-ui/react-components";

const App = () => <DBMainNavigation>MainNavigation</DBMainNavigation>;

export default App;
```
16 changes: 16 additions & 0 deletions packages/components/src/components/main-navigation/docs/Vue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Vue

For general installation and configuration look at the [v-components](https://www.npmjs.com/package/@db-ui/v-components) package.

### Use component

```vue App.vue
<!-- App.vue -->
<script>
import { DBMainNavigation } from "@db-ui/v-components";
</script>

<template>
<DBMainNavigation>MainNavigation</DBMainNavigation>
</template>
```
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as DBMainNavigation } from './main-navigation';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@forward "main-navigation";
Loading