@ndwnu/design-system 6.0.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/icons.ts +83 -0
- package/fesm2022/ndwnu-design-system.mjs +869 -929
- package/fesm2022/ndwnu-design-system.mjs.map +1 -1
- package/index.d.ts +2 -5
- package/{components → lib/components}/card/card.component.d.ts +2 -1
- package/{components → lib/components}/form-field/checkbox/checkbox.component.d.ts +3 -2
- package/{components → lib/components}/form-field/clear-search-button/clear-search-button.component.d.ts +1 -1
- package/lib/components/form-field/clear-search-button/index.d.ts +1 -0
- package/{components → lib/components}/form-field/file-upload/file-upload.component.d.ts +8 -7
- package/{components → lib/components}/form-field/input-button/input-button.component.d.ts +1 -1
- package/{components → lib/components}/form-field/month-input/month-input.component.d.ts +8 -7
- package/{components → lib/components}/form-field/option-group/option-group.component.d.ts +7 -4
- package/lib/components/form-field/picker-button/index.d.ts +1 -0
- package/{components → lib/components}/form-field/picker-button/picker-button.component.d.ts +1 -2
- package/{components → lib/components}/icon/action-icon/action-icon.component.d.ts +1 -1
- package/lib/components/icon/icon.component.d.ts +6 -0
- package/{components → lib/components}/layout/layout.component.d.ts +2 -2
- package/{components → lib/components}/main-navigation/main-navigation.component.d.ts +2 -10
- package/lib/components/tab/tab.component.d.ts +17 -0
- package/{components → lib/components}/tab-group/tab-group.component.d.ts +7 -5
- package/{components → lib/components}/toast/toast.component.d.ts +4 -4
- package/package.json +14 -8
- package/styles/base/_colors.scss +234 -0
- package/styles/base/_typography.scss +135 -0
- package/styles/base/_variables.scss +79 -0
- package/styles/base/colors.stories.model.ts +143 -0
- package/styles/base/colors.stories.ts +14 -0
- package/styles/base/colors.stories.utils.ts +58 -0
- package/styles/base/index.scss +3 -0
- package/styles/base/typography.stories.ts +116 -0
- package/styles/components/_button.scss +133 -0
- package/styles/components/_card.scss +3 -0
- package/styles/components/_divider.scss +12 -0
- package/styles/components/_dropdown.scss +8 -0
- package/styles/components/_filter-button.scss +39 -0
- package/styles/components/_input.scss +198 -0
- package/styles/components/_label.scss +23 -0
- package/styles/components/_link.scss +35 -0
- package/styles/components/_menu-button.scss +38 -0
- package/styles/components/_popover.scss +19 -0
- package/styles/components/_summary-card.scss +227 -0
- package/styles/components/divider.stories.ts +80 -0
- package/styles/components/index.scss +11 -0
- package/styles/components/link.stories.ts +154 -0
- package/styles/index.scss +4 -0
- package/styles/layout/_grid.scss +57 -0
- package/styles/layout/_overlay.scss +7 -0
- package/styles/layout/grid.stories.ts +117 -0
- package/styles/layout/index.scss +2 -0
- package/styles/storybook/_core.scss +60 -0
- package/styles/storybook/_reset.scss +20 -0
- package/styles/storybook/index.scss +17 -0
- package/styles/storybook/overrides/_buttons.scss +95 -0
- package/styles/storybook/overrides/_code-previews.scss +97 -0
- package/styles/storybook/overrides/_content.scss +24 -0
- package/styles/storybook/overrides/_headers.scss +31 -0
- package/styles/storybook/overrides/_layout.scss +44 -0
- package/styles/storybook/overrides/_table.scss +112 -0
- package/styles/storybook/overrides/index.scss +6 -0
- package/styles/storybook/overrides.css +343 -0
- package/styles/utils/_screenreader.scss +18 -0
- package/styles/utils/index.scss +1 -0
- package/assets/fonts/ObjectSans-Bold.woff2 +0 -0
- package/assets/fonts/ObjectSans-Regular.woff2 +0 -0
- package/components/icon/icon.component.d.ts +0 -13
- package/components/tab/tab.component.d.ts +0 -9
- package/core/style/styles.css +0 -1380
- package/core/style/styles.scss +0 -1380
- package/public-api.d.ts +0 -1
- package/assets/images/{ndw-logo-short.svg → logos/ndw-logo-short.svg} +0 -0
- package/assets/images/{ndw-logo.svg → logos/ndw-logo.svg} +0 -0
- package/assets/images/{nwb-logo-short.svg → logos/nwb-logo-short.svg} +0 -0
- package/assets/images/{nwb-logo.svg → logos/nwb-logo.svg} +0 -0
- package/{components → lib/components}/accordion/accordion.component.d.ts +0 -0
- package/{components → lib/components}/accordion/accordion.service.d.ts +0 -0
- package/{components → lib/components}/accordion/index.d.ts +0 -0
- package/{components → lib/components}/alert/alert.component.d.ts +0 -0
- package/{components → lib/components}/alert/alert.model.d.ts +0 -0
- package/{components → lib/components}/alert/index.d.ts +0 -0
- package/{components → lib/components}/badge/badge.component.d.ts +0 -0
- package/{components → lib/components}/badge/index.d.ts +0 -0
- package/{components → lib/components}/banner/banner.component.d.ts +0 -0
- package/{components → lib/components}/banner/banner.model.d.ts +0 -0
- package/{components → lib/components}/banner/index.d.ts +0 -0
- package/{components → lib/components}/breadcrumb/breadcrumb.component.d.ts +0 -0
- package/{components → lib/components}/breadcrumb/index.d.ts +0 -0
- package/{components → lib/components}/breadcrumb-group/breadcrumb-group.component.d.ts +0 -0
- package/{components → lib/components}/breadcrumb-group/index.d.ts +0 -0
- package/{components → lib/components}/button/button.directive.d.ts +0 -0
- package/{components → lib/components}/button/index.d.ts +0 -0
- package/{components → lib/components}/card/card-content/card-content.component.d.ts +0 -0
- package/{components → lib/components}/card/card-content/index.d.ts +0 -0
- package/{components → lib/components}/card/card-footer/card-footer.component.d.ts +0 -0
- package/{components → lib/components}/card/card-footer/index.d.ts +0 -0
- package/{components → lib/components}/card/card-header/card-header.component.d.ts +0 -0
- package/{components → lib/components}/card/card-header/index.d.ts +0 -0
- package/{components → lib/components}/card/card.animation.d.ts +0 -0
- package/{components → lib/components}/card/index.d.ts +0 -0
- package/{components → lib/components}/collapsible/collapsible.animation.d.ts +0 -0
- package/{components → lib/components}/collapsible/collapsible.component.d.ts +0 -0
- package/{components → lib/components}/collapsible/index.d.ts +0 -0
- package/{components → lib/components}/dashboard-card/dashboard-card.component.d.ts +0 -0
- package/{components → lib/components}/dashboard-card/index.d.ts +0 -0
- package/{components → lib/components}/dropdown/dropdown.component.d.ts +0 -0
- package/{components → lib/components}/dropdown/index.d.ts +0 -0
- package/{components → lib/components}/form-field/autosuggest/autosuggest-add-option/autosuggest-add-option.component.d.ts +0 -0
- package/{components → lib/components}/form-field/autosuggest/autosuggest-add-option/index.d.ts +0 -0
- package/{components → lib/components}/form-field/autosuggest/autosuggest-option/autosuggest-option.component.d.ts +0 -0
- package/{components → lib/components}/form-field/autosuggest/autosuggest-option/autosuggest-option.model.d.ts +0 -0
- package/{components → lib/components}/form-field/autosuggest/autosuggest-option/base-autosuggest-option.component.d.ts +0 -0
- package/{components → lib/components}/form-field/autosuggest/autosuggest-option/index.d.ts +0 -0
- package/{components → lib/components}/form-field/autosuggest/autosuggest-panel/autosuggest-panel.component.d.ts +0 -0
- package/{components → lib/components}/form-field/autosuggest/autosuggest.directive.d.ts +0 -0
- package/{components → lib/components}/form-field/autosuggest/index.d.ts +0 -0
- package/{components → lib/components}/form-field/autosuggest/match-bold.pipe.d.ts +0 -0
- package/{components → lib/components}/form-field/checkbox/index.d.ts +0 -0
- package/{components → lib/components}/form-field/checkbox-group/checkbox-group.component.d.ts +0 -0
- package/{components → lib/components}/form-field/checkbox-group/index.d.ts +0 -0
- package/{components → lib/components}/form-field/error/error.component.d.ts +0 -0
- package/{components → lib/components}/form-field/error/index.d.ts +0 -0
- package/{components → lib/components}/form-field/file-upload/file-upload-text.interface.d.ts +0 -0
- package/{components → lib/components}/form-field/file-upload/index.d.ts +0 -0
- package/{components → lib/components}/form-field/form-field.component.d.ts +0 -0
- package/{components → lib/components}/form-field/form-field.constant.d.ts +0 -0
- package/{components → lib/components}/form-field/form-field.model.d.ts +0 -0
- package/{components → lib/components}/form-field/index.d.ts +0 -0
- package/{components → lib/components}/form-field/info/index.d.ts +0 -0
- package/{components → lib/components}/form-field/info/info.component.d.ts +0 -0
- package/{components → lib/components}/form-field/input/index.d.ts +0 -0
- package/{components → lib/components}/form-field/input/input.directive.d.ts +0 -0
- package/{components → lib/components}/form-field/input/input.model.d.ts +0 -0
- package/{components → lib/components}/form-field/input-button/index.d.ts +0 -0
- package/{components → lib/components}/form-field/input-icon/index.d.ts +0 -0
- package/{components → lib/components}/form-field/input-icon/input-icon.component.d.ts +0 -0
- package/{components → lib/components}/form-field/month-input/index.d.ts +0 -0
- package/{components → lib/components}/form-field/month-input/month-input-utils.d.ts +0 -0
- package/{components → lib/components}/form-field/option-group/index.d.ts +0 -0
- package/{components → lib/components}/form-field/option-group/option-group.model.d.ts +0 -0
- package/{components → lib/components}/form-field/option-group/option.component.d.ts +0 -0
- package/{components → lib/components}/form-field/radio-button/index.d.ts +0 -0
- package/{components → lib/components}/form-field/radio-button/radio-button.component.d.ts +0 -0
- package/{components → lib/components}/form-field/radio-group/index.d.ts +0 -0
- package/{components → lib/components}/form-field/radio-group/radio-group.component.d.ts +0 -0
- package/{components → lib/components}/form-field/success/index.d.ts +0 -0
- package/{components → lib/components}/form-field/success/success.component.d.ts +0 -0
- package/{components → lib/components}/form-field/textarea/auto-grow.directive.d.ts +0 -0
- package/{components → lib/components}/form-field/textarea/index.d.ts +0 -0
- package/{components → lib/components}/form-field/textarea/max-char.directive.d.ts +0 -0
- package/{components → lib/components}/icon/action-icon/index.d.ts +0 -0
- package/{components → lib/components}/icon/index.d.ts +0 -0
- package/{components → lib/components}/index.d.ts +0 -0
- package/{components → lib/components}/layout/index.d.ts +0 -0
- package/{components → lib/components}/layout-banners/index.d.ts +0 -0
- package/{components → lib/components}/layout-banners/layout-banners.component.d.ts +0 -0
- package/{components → lib/components}/loader/index.d.ts +0 -0
- package/{components → lib/components}/loader/loader.component.d.ts +0 -0
- package/{components → lib/components}/main-navigation/index.d.ts +0 -0
- package/{components → lib/components}/main-navigation/main-navigation.imports.d.ts +0 -0
- package/{components → lib/components}/main-navigation/main-navigation.model.d.ts +0 -0
- package/{components → lib/components}/main-navigation-menu/index.d.ts +0 -0
- package/{components → lib/components}/main-navigation-menu/main-navigation-menu.component.d.ts +0 -0
- package/{components → lib/components}/modal/index.d.ts +0 -0
- package/{components → lib/components}/modal/modal-content/index.d.ts +0 -0
- package/{components → lib/components}/modal/modal-content/modal-content.component.d.ts +0 -0
- package/{components → lib/components}/modal/modal-footer/index.d.ts +0 -0
- package/{components → lib/components}/modal/modal-footer/modal-footer.component.d.ts +0 -0
- package/{components → lib/components}/modal/modal-header/index.d.ts +0 -0
- package/{components → lib/components}/modal/modal-header/modal-header.component.d.ts +0 -0
- package/{components → lib/components}/modal/modal-ref.d.ts +0 -0
- package/{components → lib/components}/modal/modal.component.d.ts +0 -0
- package/{components → lib/components}/modal/modal.service.d.ts +0 -0
- package/{components → lib/components}/multi-select/checkbox-data.interface.d.ts +0 -0
- package/{components → lib/components}/multi-select/index.d.ts +0 -0
- package/{components → lib/components}/multi-select/multi-select.component.d.ts +0 -0
- package/{components → lib/components}/multi-select/select-all-text.interface.d.ts +0 -0
- package/{components → lib/components}/pill/index.d.ts +0 -0
- package/{components → lib/components}/pill/pill.component.d.ts +0 -0
- package/{components → lib/components}/pill/pill.model.d.ts +0 -0
- package/{components → lib/components}/popover/index.d.ts +0 -0
- package/{components → lib/components}/popover/popover-trigger.directive.d.ts +0 -0
- package/{components → lib/components}/router-breadcrumbs/index.d.ts +0 -0
- package/{components → lib/components}/router-breadcrumbs/router-breadcrumbs.component.d.ts +0 -0
- package/{components → lib/components}/summary-card/index.d.ts +0 -0
- package/{components → lib/components}/summary-card/summary-card-action/summary-card-action.component.d.ts +0 -0
- package/{components → lib/components}/summary-card/summary-card-actions/summary-card-actions.component.d.ts +0 -0
- package/{components → lib/components}/summary-card/summary-card-avatar/summary-card-avatar.component.d.ts +0 -0
- package/{components → lib/components}/summary-card/summary-card-content/summary-card-content.component.d.ts +0 -0
- package/{components → lib/components}/summary-card/summary-card-header/summary-card-header.component.d.ts +0 -0
- package/{components → lib/components}/summary-card/summary-card-subtitle/summary-card-subtitle.component.d.ts +0 -0
- package/{components → lib/components}/summary-card/summary-card-tag/summary-card-tag.component.d.ts +0 -0
- package/{components → lib/components}/summary-card/summary-card-tags/summary-card-tags.component.d.ts +0 -0
- package/{components → lib/components}/summary-card/summary-card.component.d.ts +0 -0
- package/{components → lib/components}/summary-card/summary-card.model.d.ts +0 -0
- package/{components → lib/components}/tab/index.d.ts +0 -0
- package/{components → lib/components}/tab-group/index.d.ts +0 -0
- package/{components → lib/components}/tag/index.d.ts +0 -0
- package/{components → lib/components}/tag/tag.component.d.ts +0 -0
- package/{components → lib/components}/toast/index.d.ts +0 -0
- package/{components → lib/components}/toast/toast.service.d.ts +0 -0
- package/{components → lib/components}/tooltip/index.d.ts +0 -0
- package/{components → lib/components}/tooltip/tooltip.component.d.ts +0 -0
- package/{components → lib/components}/tooltip/tooltip.directive.d.ts +1 -1
- /package/{models → lib/models}/aria.model.d.ts +0 -0
- /package/{models → lib/models}/index.d.ts +0 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import {
|
|
2
|
+
componentWrapperDecorator,
|
|
3
|
+
moduleMetadata,
|
|
4
|
+
type Meta,
|
|
5
|
+
type StoryObj,
|
|
6
|
+
} from '@storybook/angular';
|
|
7
|
+
|
|
8
|
+
import { icons } from '../../assets/icons';
|
|
9
|
+
import { IconComponent } from '../../lib/components';
|
|
10
|
+
|
|
11
|
+
interface StoryArgs {
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
icon: string;
|
|
14
|
+
showInContext: boolean;
|
|
15
|
+
text: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const args: StoryArgs = {
|
|
19
|
+
disabled: false,
|
|
20
|
+
icon: 'schedule',
|
|
21
|
+
showInContext: false,
|
|
22
|
+
text: 'tekst',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The Link component is used to create styled anchor links with optional icons.
|
|
27
|
+
*
|
|
28
|
+
* # Usage
|
|
29
|
+
*
|
|
30
|
+
* The link styling is applied automatically to every element that has `[ndwLink]` as attribute.
|
|
31
|
+
*
|
|
32
|
+
* ```html
|
|
33
|
+
* <a ndwLink href="https://design.staging.ndw.nu/" target="_blank">
|
|
34
|
+
* <ndw-icon>schedule</ndw-icon>
|
|
35
|
+
* Voorbeeld
|
|
36
|
+
* </a>
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* ```html
|
|
40
|
+
* <button ndwLink>
|
|
41
|
+
* <ndw-icon>schedule</ndw-icon>
|
|
42
|
+
* Voorbeeld
|
|
43
|
+
* </button>
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
**/
|
|
47
|
+
|
|
48
|
+
const meta: Meta<StoryArgs> = {
|
|
49
|
+
tags: ['autodocs', 'ndw', 'nwb'],
|
|
50
|
+
title: 'Components/Link',
|
|
51
|
+
decorators: [
|
|
52
|
+
componentWrapperDecorator(
|
|
53
|
+
(story) => `<div style="font-size: var(--ndw-font-size-sm);">${story}</div>`
|
|
54
|
+
),
|
|
55
|
+
moduleMetadata({
|
|
56
|
+
imports: [IconComponent],
|
|
57
|
+
}),
|
|
58
|
+
],
|
|
59
|
+
render: (props) => ({
|
|
60
|
+
props,
|
|
61
|
+
template: `
|
|
62
|
+
<p>
|
|
63
|
+
@if (${props.showInContext}) {
|
|
64
|
+
Om een contextueel voorbeeld te schetsen is de link
|
|
65
|
+
}
|
|
66
|
+
<a
|
|
67
|
+
ndwLink
|
|
68
|
+
href="https://design.staging.ndw.nu/"
|
|
69
|
+
target="_blank"
|
|
70
|
+
${props.disabled ? 'disabled' : ''}
|
|
71
|
+
>
|
|
72
|
+
${props.icon ? `<ndw-icon>${props.icon}</ndw-icon>` : ''}
|
|
73
|
+
a element ${props.text}
|
|
74
|
+
</a>
|
|
75
|
+
@if (${props.showInContext}) {
|
|
76
|
+
in deze zin geplaatst.
|
|
77
|
+
}
|
|
78
|
+
</p>
|
|
79
|
+
|
|
80
|
+
<p>
|
|
81
|
+
@if (${props.showInContext}) {
|
|
82
|
+
Om een contextueel voorbeeld te schetsen is de link
|
|
83
|
+
}
|
|
84
|
+
<button
|
|
85
|
+
ndwLink
|
|
86
|
+
${props.disabled ? 'disabled' : ''}
|
|
87
|
+
>
|
|
88
|
+
${props.icon ? `<ndw-icon>${props.icon}</ndw-icon>` : ''}
|
|
89
|
+
button element ${props.text}
|
|
90
|
+
</button>
|
|
91
|
+
@if (${props.showInContext}) {
|
|
92
|
+
in deze zin geplaatst.
|
|
93
|
+
}
|
|
94
|
+
</p>
|
|
95
|
+
`,
|
|
96
|
+
}),
|
|
97
|
+
argTypes: {
|
|
98
|
+
disabled: {
|
|
99
|
+
description: 'Whether the link is disabled.',
|
|
100
|
+
name: 'disabled',
|
|
101
|
+
table: {
|
|
102
|
+
category: 'Custom content',
|
|
103
|
+
defaultValue: { summary: 'false' },
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
icon: {
|
|
107
|
+
control: 'select',
|
|
108
|
+
options: ['', ...icons],
|
|
109
|
+
description: 'The name of the icon to display.',
|
|
110
|
+
name: 'icon',
|
|
111
|
+
table: {
|
|
112
|
+
category: 'Custom content',
|
|
113
|
+
defaultValue: { summary: 'undefined' },
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
showInContext: {
|
|
117
|
+
description: 'Whether to show the link in context.',
|
|
118
|
+
name: 'showInContext',
|
|
119
|
+
table: {
|
|
120
|
+
category: 'Custom content',
|
|
121
|
+
defaultValue: { summary: 'false' },
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
text: {
|
|
125
|
+
description: 'The text to display in the link.',
|
|
126
|
+
name: 'text',
|
|
127
|
+
table: {
|
|
128
|
+
category: 'Custom content',
|
|
129
|
+
defaultValue: { summary: 'undefined' },
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
export default meta;
|
|
135
|
+
type Story = StoryObj<StoryArgs>;
|
|
136
|
+
|
|
137
|
+
export const Default: Story = {
|
|
138
|
+
args,
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export const Disabled: Story = {
|
|
142
|
+
args: {
|
|
143
|
+
...args,
|
|
144
|
+
disabled: true,
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export const InContext: Story = {
|
|
149
|
+
args: {
|
|
150
|
+
...args,
|
|
151
|
+
icon: '',
|
|
152
|
+
showInContext: true,
|
|
153
|
+
},
|
|
154
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
@use '../base/variables' as *;
|
|
2
|
+
|
|
3
|
+
@mixin column($span) {
|
|
4
|
+
grid-column: span $span;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.grid {
|
|
8
|
+
$grid-columns-sm: 6;
|
|
9
|
+
$grid-columns-md: 12;
|
|
10
|
+
|
|
11
|
+
display: grid;
|
|
12
|
+
justify-items: stretch;
|
|
13
|
+
grid-template-columns: repeat(var(--grid-columns), minmax(1rem, 1fr));
|
|
14
|
+
gap: var(--grid-spacing);
|
|
15
|
+
padding: 0 var(--grid-spacing);
|
|
16
|
+
margin: 0 auto;
|
|
17
|
+
width: 100%;
|
|
18
|
+
min-width: min-content;
|
|
19
|
+
max-width: $ndw-screen-md;
|
|
20
|
+
|
|
21
|
+
@for $i from 1 through $grid-columns-md {
|
|
22
|
+
.column-#{$i} {
|
|
23
|
+
// Use min to make sure we don't span more columns than available
|
|
24
|
+
@include column(min($i, var(--grid-columns)));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@media screen and (max-width: $ndw-screen-sm) {
|
|
29
|
+
--grid-columns: #{$grid-columns-sm};
|
|
30
|
+
--grid-spacing: var(--ndw-spacing-md);
|
|
31
|
+
|
|
32
|
+
@for $i from 1 through $grid-columns-md {
|
|
33
|
+
.column-md-#{$i} {
|
|
34
|
+
display: none;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@for $i from 1 through $grid-columns-sm {
|
|
39
|
+
.column-sm-#{$i} {
|
|
40
|
+
@include column($i);
|
|
41
|
+
display: initial;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@media screen and (min-width: calc($ndw-screen-sm + 1px)) {
|
|
47
|
+
--grid-columns: #{$grid-columns-md};
|
|
48
|
+
--grid-spacing: var(--ndw-spacing-lg);
|
|
49
|
+
|
|
50
|
+
@for $i from 1 through $grid-columns-md {
|
|
51
|
+
.column-md-#{$i} {
|
|
52
|
+
@include column($i);
|
|
53
|
+
display: initial;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/angular';
|
|
2
|
+
|
|
3
|
+
interface StoryArgs {
|
|
4
|
+
columnClasses: string[][];
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Create a grid layout with columns. There is one responsive breakpoint at 1024px
|
|
9
|
+
* screen width;
|
|
10
|
+
* - Above 1024px, the grid has 12 columns.
|
|
11
|
+
* - Below 1024px, the grid has 6 columns.
|
|
12
|
+
* - The grid has a maximum width of 1440px.
|
|
13
|
+
*
|
|
14
|
+
* The grid needs a container element with the class `grid` and each column element
|
|
15
|
+
* should have a `column-{span}`, `column-sm-{span}` or `column-md-{span}`
|
|
16
|
+
* class where `{span}` is the number of grid columns the element should span.
|
|
17
|
+
*
|
|
18
|
+
* `column-{span}` classes set the column width for all screen sizes. Different column
|
|
19
|
+
* widths can be set for different screen sizes using `column-sm-{span}` and
|
|
20
|
+
* `column-md-{span}` classes. Columns with only a `column-md-{span}` class will
|
|
21
|
+
* only be visible on screen widths above 1024px.
|
|
22
|
+
*
|
|
23
|
+
* When viewing a specific story, use the viewport tool to see how the grid layout
|
|
24
|
+
* responds to different screen sizes.
|
|
25
|
+
*
|
|
26
|
+
* The colors of the background and grid columns are for illustrative purposes.
|
|
27
|
+
*/
|
|
28
|
+
const meta: Meta<StoryArgs> = {
|
|
29
|
+
tags: ['autodocs', 'ndw', 'ntm', 'nwb'],
|
|
30
|
+
title: 'Core/Grid',
|
|
31
|
+
parameters: {
|
|
32
|
+
viewport: {
|
|
33
|
+
defaultViewport: 'mobile',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
render: (props) => ({
|
|
37
|
+
props,
|
|
38
|
+
styles: [
|
|
39
|
+
`
|
|
40
|
+
.grid > div {
|
|
41
|
+
background-color: var(--ndw-color-grey-300);
|
|
42
|
+
padding: var(--ndw-spacing-xs);
|
|
43
|
+
}
|
|
44
|
+
.grid {
|
|
45
|
+
background-color: var(--ndw-color-grey-100);
|
|
46
|
+
margin-bottom: var(--ndw-spacing-xl);
|
|
47
|
+
}
|
|
48
|
+
`,
|
|
49
|
+
],
|
|
50
|
+
template: `
|
|
51
|
+
<div class="grid">
|
|
52
|
+
${props.columnClasses
|
|
53
|
+
.map(
|
|
54
|
+
(classes, index) =>
|
|
55
|
+
`<div class="${classes.join(' ')}">
|
|
56
|
+
${index + 1}
|
|
57
|
+
</div>`
|
|
58
|
+
)
|
|
59
|
+
.join('')}
|
|
60
|
+
</div>
|
|
61
|
+
`,
|
|
62
|
+
}),
|
|
63
|
+
argTypes: {
|
|
64
|
+
columnClasses: {
|
|
65
|
+
description: 'Array of classes to apply to each column.',
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
export default meta;
|
|
70
|
+
type Story = StoryObj<StoryArgs>;
|
|
71
|
+
|
|
72
|
+
export const Default: Story = {
|
|
73
|
+
args: {
|
|
74
|
+
columnClasses: [
|
|
75
|
+
['column-sm-1', 'column-md-1'],
|
|
76
|
+
['column-sm-1', 'column-md-1'],
|
|
77
|
+
['column-sm-1', 'column-md-1'],
|
|
78
|
+
['column-sm-1', 'column-md-1'],
|
|
79
|
+
['column-sm-1', 'column-md-1'],
|
|
80
|
+
['column-sm-1', 'column-md-1'],
|
|
81
|
+
['column-md-1'],
|
|
82
|
+
['column-md-1'],
|
|
83
|
+
['column-md-1'],
|
|
84
|
+
['column-md-1'],
|
|
85
|
+
['column-md-1'],
|
|
86
|
+
['column-md-1'],
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Use the viewport button to see different column sizes for different screen sizes.
|
|
93
|
+
*/
|
|
94
|
+
export const ChangeOnMobile: Story = {
|
|
95
|
+
args: {
|
|
96
|
+
columnClasses: [
|
|
97
|
+
['column-md-4', 'column-sm-3'],
|
|
98
|
+
['column-md-4', 'column-sm-3'],
|
|
99
|
+
['column-md-4', 'column-sm-6'],
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export const MixedColumnWidth: Story = {
|
|
105
|
+
args: {
|
|
106
|
+
columnClasses: [
|
|
107
|
+
['column-3'],
|
|
108
|
+
['column-3'],
|
|
109
|
+
['column-4'],
|
|
110
|
+
['column-2'],
|
|
111
|
+
['column-2'],
|
|
112
|
+
['column-4'],
|
|
113
|
+
['column-6'],
|
|
114
|
+
['column-12'],
|
|
115
|
+
],
|
|
116
|
+
},
|
|
117
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
.overview {
|
|
2
|
+
align-content: flex-start;
|
|
3
|
+
display: grid;
|
|
4
|
+
gap: var(--ndw-spacing-xl);
|
|
5
|
+
|
|
6
|
+
> h1 {
|
|
7
|
+
margin-bottom: 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
section {
|
|
11
|
+
display: grid;
|
|
12
|
+
gap: var(--ndw-spacing-sm);
|
|
13
|
+
|
|
14
|
+
> h2 {
|
|
15
|
+
margin-block: 0 var(--ndw-spacing-lg);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
> p {
|
|
19
|
+
padding-bottom: var(--ndw-spacing-lg);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.header,
|
|
23
|
+
.content {
|
|
24
|
+
display: grid;
|
|
25
|
+
gap: var(--ndw-spacing-md);
|
|
26
|
+
grid-template-columns: repeat(3, 2fr);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.header {
|
|
30
|
+
font-weight: var(--ndw-font-weight-bold);
|
|
31
|
+
margin-top: calc(var(--ndw-spacing-md) * -1);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.content {
|
|
35
|
+
.block {
|
|
36
|
+
border: var(--ndw-border-size-sm) solid var(--ndw-color-grey-400);
|
|
37
|
+
height: var(--ndw-spacing-3xl);
|
|
38
|
+
width: var(--ndw-spacing-3xl);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&.colors {
|
|
44
|
+
section {
|
|
45
|
+
.header,
|
|
46
|
+
.content {
|
|
47
|
+
grid-template-columns: 3.5rem repeat(2, 2fr) 3fr;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&.typography {
|
|
53
|
+
section {
|
|
54
|
+
.header,
|
|
55
|
+
.content {
|
|
56
|
+
grid-template-columns: 4fr 2fr 7fr;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
* {
|
|
2
|
+
-webkit-font-smoothing: antialiased;
|
|
3
|
+
-moz-osx-font-smoothing: grayscale;
|
|
4
|
+
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
5
|
+
-webkit-overflow-scrolling: touch;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
body {
|
|
10
|
+
font-family: var(--ndw-font-family-body);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
h1,
|
|
14
|
+
h2,
|
|
15
|
+
h3,
|
|
16
|
+
h4,
|
|
17
|
+
h5,
|
|
18
|
+
h6 {
|
|
19
|
+
font-family: var(--ndw-font-family-heading);
|
|
20
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@forward 'reset';
|
|
2
|
+
@forward 'overrides';
|
|
3
|
+
@forward 'core';
|
|
4
|
+
|
|
5
|
+
.sb {
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
display: flex;
|
|
8
|
+
gap: var(--ndw-spacing-3xl);
|
|
9
|
+
justify-content: center;
|
|
10
|
+
min-height: calc(100vh - 8rem);
|
|
11
|
+
padding: 4rem 1.5rem;
|
|
12
|
+
|
|
13
|
+
&_content {
|
|
14
|
+
max-width: 61.5rem;
|
|
15
|
+
width: 100%;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
button,
|
|
2
|
+
div.css-1xrl4hz button,
|
|
3
|
+
div.css-gg4vpm button {
|
|
4
|
+
&.css-17dxjer,
|
|
5
|
+
&.css-8gf0gt,
|
|
6
|
+
&.css-otxova,
|
|
7
|
+
&.docblock-code-toggle {
|
|
8
|
+
background-color: transparent;
|
|
9
|
+
border-radius: var(--ndw-border-radius-sm);
|
|
10
|
+
|
|
11
|
+
&:focus {
|
|
12
|
+
box-shadow: none;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* Grey outline buttons */
|
|
17
|
+
// Copy button in code block
|
|
18
|
+
&.css-otxova {
|
|
19
|
+
border: var(--ndw-border-size-sm) solid var(--ndw-color-grey-300);
|
|
20
|
+
color: var(--ndw-color-grey-600);
|
|
21
|
+
|
|
22
|
+
&:hover {
|
|
23
|
+
background-color: var(--ndw-color-grey-400);
|
|
24
|
+
border-color: var(--ndw-color-grey-400);
|
|
25
|
+
color: var(--ndw-color-white);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&:active {
|
|
29
|
+
background-color: var(--ndw-color-grey-500);
|
|
30
|
+
border-color: var(--ndw-color-grey-500);
|
|
31
|
+
color: var(--ndw-color-white);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* Interactive icons */
|
|
36
|
+
// Icon buttons above docs example
|
|
37
|
+
&.css-17dxjer,
|
|
38
|
+
// Reset button in table header
|
|
39
|
+
&.css-8gf0gt {
|
|
40
|
+
color: var(--ndw-color-background);
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
position: relative;
|
|
43
|
+
|
|
44
|
+
&::before {
|
|
45
|
+
background-color: var(--ndw-color-grey-300);
|
|
46
|
+
content: '';
|
|
47
|
+
inset: 0;
|
|
48
|
+
opacity: 0;
|
|
49
|
+
position: absolute;
|
|
50
|
+
transition: opacity 150ms ease-in-out;
|
|
51
|
+
z-index: -1;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&:hover {
|
|
55
|
+
background-color: var(--ndw-alpha-black-007);
|
|
56
|
+
color: var(--ndw-color-background-hover);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&:active,
|
|
60
|
+
&:focus,
|
|
61
|
+
&:focus-visible {
|
|
62
|
+
background-color: var(--ndw-alpha-black-015);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&:focus-visible {
|
|
66
|
+
background-color: transparent;
|
|
67
|
+
color: var(--ndw-color-background-active);
|
|
68
|
+
outline-color: var(--ndw-color-secondary-500);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* Primary outline buttons */
|
|
73
|
+
// Show code button
|
|
74
|
+
&.docblock-code-toggle {
|
|
75
|
+
border: var(--ndw-border-size-sm) solid var(--ndw-color-background);
|
|
76
|
+
color: var(--ndw-color-background);
|
|
77
|
+
transition: (
|
|
78
|
+
background-color 150ms ease-in-out,
|
|
79
|
+
border-color 150ms ease-in-out,
|
|
80
|
+
color 150ms ease-in-out
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
&:hover {
|
|
84
|
+
background-color: var(--ndw-color-background);
|
|
85
|
+
border-color: var(--ndw-color-background);
|
|
86
|
+
color: var(--ndw-color-foreground);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&:active {
|
|
90
|
+
background-color: var(--ndw-color-background-hover);
|
|
91
|
+
border-color: var(--ndw-color-background-hover);
|
|
92
|
+
color: var(--ndw-color-foreground-hover);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
div {
|
|
2
|
+
--ndw-sb-color-primary: hsl(19, 100%, 40%);
|
|
3
|
+
--ndw-sb-color-primary-100: hsl(19, 100%, 80%);
|
|
4
|
+
|
|
5
|
+
&.css-1xrl4hz,
|
|
6
|
+
&.css-12u9f4 {
|
|
7
|
+
pre {
|
|
8
|
+
&.prismjs {
|
|
9
|
+
background-color: var(--ndw-color-grey-700);
|
|
10
|
+
border-radius: var(--ndw-border-radius-sm);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Background copy button in code preview
|
|
16
|
+
&.css-111a2cx {
|
|
17
|
+
background-color: var(--ndw-color-white);
|
|
18
|
+
border-radius: var(--ndw-border-radius-sm);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&.language-bash,
|
|
22
|
+
&.language-json,
|
|
23
|
+
&.language-json.css-1lwmlsb,
|
|
24
|
+
&.language-html,
|
|
25
|
+
&.language-ts,
|
|
26
|
+
&.language-typescript {
|
|
27
|
+
color: var(--ndw-color-white);
|
|
28
|
+
font-family: monospace;
|
|
29
|
+
|
|
30
|
+
span {
|
|
31
|
+
color: var(--ndw-color-white);
|
|
32
|
+
font-family: monospace;
|
|
33
|
+
|
|
34
|
+
&.token {
|
|
35
|
+
&.assign-left {
|
|
36
|
+
color: var(--ndw-sb-color-primary);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&.attr-name {
|
|
40
|
+
color: var(--ndw-sb-color-primary-100);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&.attr-value {
|
|
44
|
+
color: var(--ndw-color-grey-200);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&.comment {
|
|
48
|
+
color: var(--ndw-color-data-a-100);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&.decorator {
|
|
52
|
+
color: var(--ndw-color-data-d-100);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&.function {
|
|
56
|
+
color: var(--ndw-sb-color-primary);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&.keyword {
|
|
60
|
+
color: var(--ndw-sb-color-primary);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&.operator {
|
|
64
|
+
color: var(--ndw-sb-color-primary-100);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&.property {
|
|
68
|
+
color: var(--ndw-color-data-c-100);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&.punctuation {
|
|
72
|
+
color: var(--ndw-color-grey-300);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&.string {
|
|
76
|
+
color: var(--ndw-color-data-d-100);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&.tag {
|
|
80
|
+
color: var(--ndw-sb-color-primary);
|
|
81
|
+
|
|
82
|
+
&.attr-name {
|
|
83
|
+
color: var(--ndw-sb-color-primary-100);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&.attr-value {
|
|
87
|
+
color: var(--ndw-color-grey-200);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&.punctuation {
|
|
91
|
+
color: var(--ndw-color-grey-300);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.css-qa4clq {
|
|
2
|
+
a,
|
|
3
|
+
p,
|
|
4
|
+
ul,
|
|
5
|
+
li {
|
|
6
|
+
font-family: var(--ndw-font-family-body);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
ul {
|
|
10
|
+
list-style-type: none;
|
|
11
|
+
padding: 0 0 0 var(--ndw-spacing-sm);
|
|
12
|
+
|
|
13
|
+
li {
|
|
14
|
+
margin: 0;
|
|
15
|
+
|
|
16
|
+
&::before {
|
|
17
|
+
content: '-';
|
|
18
|
+
display: inline-block;
|
|
19
|
+
width: var(--ndw-spacing-sm);
|
|
20
|
+
text-align: center;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
h1,
|
|
2
|
+
h2,
|
|
3
|
+
h3,
|
|
4
|
+
h4,
|
|
5
|
+
h5,
|
|
6
|
+
h6 {
|
|
7
|
+
&.css-wzniqs,
|
|
8
|
+
&.sbdocs-title {
|
|
9
|
+
font-family: var(--ndw-font-family-heading);
|
|
10
|
+
font-weight: var(--ndw-font-weight-bold);
|
|
11
|
+
margin-block: 0 var(--ndw-spacing-xl);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
h1,
|
|
16
|
+
h1.css-wzniqs,
|
|
17
|
+
h1.sbdocs-title {
|
|
18
|
+
font-size: var(--ndw-font-size-xl);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
h2,
|
|
22
|
+
h2.css-wzniqs,
|
|
23
|
+
h2.sbdocs-title {
|
|
24
|
+
font-size: var(--ndw-font-size-lg);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
h3,
|
|
28
|
+
h3.css-wzniqs,
|
|
29
|
+
h3.sbdocs-title {
|
|
30
|
+
font-size: var(--ndw-font-size-md);
|
|
31
|
+
}
|