Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e9dac0b
feat: add navigation-item component
nmerget Jun 20, 2023
fe1852a
Merge branch 'main' into feat-nav-item-component
nmerget Jun 20, 2023
972f22b
feat: add main-navigation (#1172)
nmerget Jun 21, 2023
664e122
Revert "feat: add main-navigation (#1172)"
nmerget Jun 23, 2023
ed691d0
fix: revert main-navigation changes
nmerget Jun 23, 2023
9572995
Merge branch 'main' into feat-nav-item-component
nmerget Jun 23, 2023
7dd4f50
Merge branch 'main' of github.com:db-ui/mono into feat-nav-item-compo…
nmerget Jun 26, 2023
a3d0e47
fix: issue with brand logo
nmerget Jun 26, 2023
55a7676
Merge remote-tracking branch 'origin/feat-nav-item-component' into fe…
nmerget Jun 26, 2023
e70fed7
fix: issue with vue navigation-item
nmerget Jun 26, 2023
4af4f4a
Merge branch 'main' of github.com:db-ui/mono into feat-nav-item-compo…
nmerget Jun 29, 2023
98052ad
chore: update screenshots
nmerget Jun 29, 2023
044117a
chore: update snapshots
nmerget Jun 29, 2023
247851c
Merge branch 'main' into feat-nav-item-component
mfranzke Jul 2, 2023
d3797a3
Merge branch 'main' into feat-nav-item-component
mfranzke Jul 2, 2023
83075d6
fix: some issues from PR
nmerget Jul 3, 2023
626502c
fix: removed additional functions in navigation-item
nmerget Jul 4, 2023
6e59089
Merge branch 'main' into feat-nav-item-component
nmerget Jul 4, 2023
68ae20d
fix: issue with wrong prop
nmerget Jul 4, 2023
a9dceb1
Merge branch 'main' into feat-nav-item-component
nmerget Jul 4, 2023
8b9c2d6
Merge branch 'main' into feat-nav-item-component
nmerget Jul 4, 2023
68e8500
Merge branch 'main' of github.com:db-ui/mono into feat-nav-item-compo…
nmerget Jul 4, 2023
de9b4ba
chore: update from main
nmerget Jul 4, 2023
e5fe031
Merge branch 'main' into feat-nav-item-component
nmerget Jul 6, 2023
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ output/power-apps
showcases/patternhub/public/iframe-resizer/*

/showcases/**/test-results/

/__snapshots__/**/*-win32.png
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.
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.
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.
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { DBNavigationItem, DBNavigationItemModule } from './navigation-item';
26 changes: 4 additions & 22 deletions packages/components/scripts/post-build/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
* }]}
*/
const getComponents = () => [
{
name: 'navigation-item'
},

{
name: 'select'
},
Expand All @@ -29,12 +33,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 +46,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 +58,6 @@ const getComponents = () => [

{
name: 'radio',
overwrites: {
vue: [
{
from: 'immediate: true,',
to: 'immediate: true,\nflush: "post"'
}
]
},
config: {
vue: {
vModel: [{ modelValue: 'checked', binding: ':checked' }]
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
1 change: 1 addition & 0 deletions packages/components/src/components/brand/brand.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
}

.db-logo {
max-width: none;
height: $db-sizing-sm;
@media screen and (min-width: $db-screens-m) {
height: $db-sizing-md;
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
8 changes: 2 additions & 6 deletions packages/components/src/components/header/header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
/* Mobile header should always be 56px */
min-height: to-rem(56);

padding-left: $db-spacing-fixed-md;
padding-right: $db-spacing-fixed-md;
gap: $db-spacing-fixed-md;
padding-inline: $db-spacing-fixed-md;

.db-link {
display: inline-block;
Expand All @@ -39,10 +39,6 @@

.desktop-navigation {
display: inherit;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
}
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
26 changes: 26 additions & 0 deletions packages/components/src/components/navigation-item/docs/Angular.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## 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 { DBNavigationItemModule } from '@db-ui/ngx-components';

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

```

### Use component

```html app.component.html
<!-- app.component.html -->
<a routerLink="mypath">
<db-navigation-item>NavigationItem</db-navigation-item>
</a>
```
20 changes: 20 additions & 0 deletions packages/components/src/components/navigation-item/docs/HTML.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## 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>
<a href="mypath">
<li aria-haspopup="false" class="db-navigation-item">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NavigationItem

<!-- If you want to use it as main-naivgation with pulse-->
<div class="active-indicator" />
Comment on lines +15 to +16
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should check whether we really need a block level element for this and cannot achieve it either via ::after { content: ""; } or at least changing it to a <span>.

</li>
</a>
</body>
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## General

> **Note**
> For a general installation or migration process check out this [documentation](https://www.npmjs.com/package/@db-ui/components).

## DB UI Core ➡ DB UI Components

New Component 🥳
19 changes: 19 additions & 0 deletions packages/components/src/components/navigation-item/docs/React.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## 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 { Link } from "react-router-dom";
import { DBNavigationItem } from "@db-ui/react-components";

const App = () => (
<Link to="mypath">
<DBNavigationItem>NavigationItem</DBNavigationItem>
</Link>
);

export default App;
```
18 changes: 18 additions & 0 deletions packages/components/src/components/navigation-item/docs/Vue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## 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 { DBNavigationItem } from "@db-ui/v-components";
</script>

<template>
<router-link to="mypath">
<DBNavigationItem>NavigationItem</DBNavigationItem>
</router-link>
</template>
```
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as DBNavigationItem } from './navigation-item';
48 changes: 48 additions & 0 deletions packages/components/src/components/navigation-item/model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import {
ClickEventProps,
ClickEventState,
GlobalProps,
GlobalState,
IconAfterProps,
IconProps,
IconState,
InitializedState,
WidthProps
} from '../../shared/model';

export interface DBNavigationItemDefaultProps {
/**
* Indicator for active navigation item (bold font).
*/
active?: boolean;

/**
* The disabled attribute can be set to [keep a user from clicking on the item](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#disabled).
*/
disabled?: boolean;

/**
* React-specific property to pass in a slot for sub-navigation
*/

slotSubNavigation?: any;
}

export type DBNavigationItemProps = DBNavigationItemDefaultProps &
GlobalProps &
ClickEventProps &
IconProps &
IconAfterProps &
WidthProps;

export interface DBNavigationItemDefaultState {
hasAreaPopup: boolean;
subNavigationId: string;
hideSubNavigation?: boolean;
}

export type DBNavigationItemState = DBNavigationItemDefaultState &
ClickEventState &
GlobalState &
IconState &
InitializedState;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@forward "navigation-item";
Loading