@boostdev/design-system-components 1.1.2 → 1.2.1
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/AGENTS.md +38 -14
- package/dist/client.cjs +85 -103
- package/dist/client.css +610 -601
- package/dist/client.d.cts +13 -16
- package/dist/client.d.ts +13 -16
- package/dist/client.js +95 -113
- package/dist/index.cjs +85 -103
- package/dist/index.css +610 -601
- package/dist/index.d.cts +13 -16
- package/dist/index.d.ts +13 -16
- package/dist/index.js +95 -113
- package/dist/native/index.cjs +9 -8
- package/dist/native/index.d.cts +1 -1
- package/dist/native/index.d.ts +1 -1
- package/dist/native/index.js +9 -8
- package/dist/web-components/{chunk-K5CE6HSB.js → chunk-2FGATTGT.js} +79 -17
- package/dist/web-components/{chunk-O4UFI2RX.js → chunk-3REOIRDW.js} +13 -11
- package/dist/web-components/{chunk-5IPHEONG.js → chunk-6I2DBFQ7.js} +1 -0
- package/dist/web-components/{chunk-VM3YHGQ2.js → chunk-AJSXNDAP.js} +1 -2
- package/dist/web-components/{chunk-LSC4N56Q.js → chunk-BX3IPVOB.js} +1 -2
- package/dist/web-components/{chunk-CAPI25CU.js → chunk-DZRSJGPB.js} +3 -3
- package/dist/web-components/{chunk-VSS5ITNE.js → chunk-EBJM3VD4.js} +1 -3
- package/dist/web-components/{chunk-O7I63SQX.js → chunk-HHHRF2PS.js} +6 -12
- package/dist/web-components/{chunk-OTX4COSV.js → chunk-JUKB3BUP.js} +3 -4
- package/dist/web-components/{chunk-IQGLIQSO.js → chunk-N6IMUOY4.js} +2 -5
- package/dist/web-components/{chunk-CJ5ZOO42.js → chunk-OCODKRVZ.js} +68 -44
- package/dist/web-components/{chunk-QDRH46TF.js → chunk-QLZ2362S.js} +1 -3
- package/dist/web-components/{chunk-IK3PTFZ4.js → chunk-T6AETZRP.js} +1 -3
- package/dist/web-components/{chunk-4BX6AWXX.js → chunk-X3FKVHLK.js} +2 -4
- package/dist/web-components/{chunk-A67LCT7C.js → chunk-XNA6WTXG.js} +3 -4
- package/dist/web-components/{chunk-XIENXR7H.js → chunk-YRXCVKHV.js} +1 -3
- package/dist/web-components/{chunk-6T3RKUKG.js → chunk-ZTC6GRP7.js} +1 -2
- package/dist/web-components/globals.js +1 -1
- package/dist/web-components/index.d.ts +571 -1
- package/dist/web-components/index.js +1515 -18
- package/dist/web-components/interaction/bds-accordion.js +1 -1
- package/dist/web-components/interaction/bds-button.d.ts +2 -2
- package/dist/web-components/interaction/bds-button.js +1 -1
- package/dist/web-components/interaction/bds-collapsible.js +1 -1
- package/dist/web-components/interaction/bds-dialog.js +1 -1
- package/dist/web-components/interaction/bds-drawer.js +1 -1
- package/dist/web-components/interaction/form/bds-checkbox.js +1 -1
- package/dist/web-components/interaction/form/bds-combobox.js +1 -1
- package/dist/web-components/interaction/form/bds-number-input.js +1 -1
- package/dist/web-components/interaction/form/bds-radio.js +1 -1
- package/dist/web-components/interaction/form/bds-segmented-control.d.ts +20 -3
- package/dist/web-components/interaction/form/bds-segmented-control.js +1 -1
- package/dist/web-components/interaction/form/bds-select.js +1 -1
- package/dist/web-components/interaction/form/bds-switch.js +1 -1
- package/dist/web-components/interaction/form/bds-textarea.js +1 -1
- package/dist/web-components/ui/bds-alert.js +1 -1
- package/dist/web-components/ui/bds-card.js +1 -1
- package/dist/web-components/ui/bds-notification-banner.js +1 -1
- package/package.json +2 -2
- package/src/components/interaction/Button/Button.module.css +12 -11
- package/src/components/interaction/Button/Button.native.tsx +10 -9
- package/src/components/interaction/Button/Button.tsx +1 -1
- package/src/components/interaction/Command/Command.module.css +3 -7
- package/src/components/interaction/Dialog/Dialog.module.css +7 -5
- package/src/components/interaction/Drawer/Drawer.module.css +48 -25
- package/src/components/interaction/Drawer/Drawer.tsx +21 -17
- package/src/components/interaction/DropdownMenu/DropdownMenu.module.css +1 -3
- package/src/components/interaction/Popover/Popover.module.css +1 -3
- package/src/components/interaction/form/Checkbox/Checkbox.module.css +1 -3
- package/src/components/interaction/form/Combobox/Combobox.module.css +2 -6
- package/src/components/interaction/form/FormInput/FormInput.module.css +1 -3
- package/src/components/interaction/form/NumberInput/NumberInput.module.css +16 -4
- package/src/components/interaction/form/Radio/Radio.module.css +6 -16
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.mdx +74 -25
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.module.css +65 -36
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.spec.tsx +127 -56
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.stories.tsx +89 -72
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.tsx +40 -62
- package/src/components/interaction/form/SegmentedControl/index.ts +1 -1
- package/src/components/interaction/form/Select/Select.module.css +2 -4
- package/src/components/interaction/form/Switch/Switch.module.css +5 -7
- package/src/components/interaction/form/Switch/Switch.native.spec.tsx +9 -9
- package/src/components/interaction/form/Switch/Switch.native.tsx +2 -2
- package/src/components/interaction/form/Textarea/Textarea.module.css +1 -3
- package/src/components/interaction/form/atoms/InputContainer.stories.tsx +64 -0
- package/src/components/interaction/form/atoms/Label.stories.tsx +33 -0
- package/src/components/interaction/form/atoms/Message.stories.tsx +33 -0
- package/src/components/layout/Card/Card.module.css +1 -3
- package/src/components/ui/Accordion/Accordion.module.css +1 -2
- package/src/components/ui/Alert/Alert.module.css +1 -2
- package/src/components/ui/Calendar/Calendar.module.css +2 -5
- package/src/components/ui/Carousel/Carousel.module.css +1 -3
- package/src/components/ui/NotificationBanner/NotificationBanner.module.css +1 -2
- package/src/components/ui/Pagination/Pagination.module.css +1 -2
- package/src/components/ui/SkipLink/SkipLink.module.css +1 -2
- package/src/components/ui/Table/Table.module.css +1 -2
- package/src/css/bdc.css +16 -11
- package/src/index.ts +1 -1
- package/src/stories/Introduction.mdx +2 -1
- package/src/web-components/globals.ts +3 -3
- package/src/web-components/index.ts +12 -0
- package/src/web-components/interaction/BdsAccordion.mdx +103 -0
- package/src/web-components/interaction/BdsAccordion.stories.tsx +94 -0
- package/src/web-components/interaction/BdsCollapsible.mdx +116 -0
- package/src/web-components/interaction/BdsCollapsible.stories.tsx +68 -0
- package/src/web-components/interaction/BdsDialog.mdx +110 -0
- package/src/web-components/interaction/BdsDialog.stories.tsx +157 -0
- package/src/web-components/interaction/BdsDrawer.mdx +108 -0
- package/src/web-components/interaction/BdsDrawer.stories.tsx +196 -0
- package/src/web-components/interaction/BdsDropdownMenu.mdx +108 -0
- package/src/web-components/interaction/BdsDropdownMenu.stories.tsx +91 -0
- package/src/web-components/interaction/BdsSkipLink.mdx +90 -0
- package/src/web-components/interaction/BdsSkipLink.stories.tsx +68 -0
- package/src/web-components/interaction/BdsTabs.mdx +117 -0
- package/src/web-components/interaction/BdsTabs.stories.tsx +94 -0
- package/src/web-components/interaction/BdsTooltip.mdx +104 -0
- package/src/web-components/interaction/BdsTooltip.stories.tsx +87 -0
- package/src/web-components/interaction/bds-accordion.ts +1 -2
- package/src/web-components/interaction/bds-button.ts +15 -13
- package/src/web-components/interaction/bds-collapsible.ts +1 -0
- package/src/web-components/interaction/bds-dialog.ts +2 -5
- package/src/web-components/interaction/bds-drawer.ts +70 -44
- package/src/web-components/interaction/bds-dropdown-menu-item.ts +124 -0
- package/src/web-components/interaction/bds-dropdown-menu.spec.ts +102 -0
- package/src/web-components/interaction/bds-dropdown-menu.ts +200 -0
- package/src/web-components/interaction/form/BdsCheckbox.mdx +76 -0
- package/src/web-components/interaction/form/BdsCheckbox.stories.tsx +72 -0
- package/src/web-components/interaction/form/BdsCheckboxGroup.mdx +70 -0
- package/src/web-components/interaction/form/BdsCheckboxGroup.stories.tsx +81 -0
- package/src/web-components/interaction/form/BdsCombobox.mdx +71 -0
- package/src/web-components/interaction/form/BdsCombobox.stories.tsx +93 -0
- package/src/web-components/interaction/form/BdsFileInput.mdx +79 -0
- package/src/web-components/interaction/form/BdsFileInput.stories.tsx +69 -0
- package/src/web-components/interaction/form/BdsFormInput.mdx +98 -0
- package/src/web-components/interaction/form/BdsFormInput.stories.tsx +139 -0
- package/src/web-components/interaction/form/BdsNumberInput.mdx +70 -0
- package/src/web-components/interaction/form/BdsNumberInput.stories.tsx +68 -0
- package/src/web-components/interaction/form/BdsRadio.mdx +72 -0
- package/src/web-components/interaction/form/BdsRadio.stories.tsx +58 -0
- package/src/web-components/interaction/form/BdsRadioGroup.mdx +73 -0
- package/src/web-components/interaction/form/BdsRadioGroup.stories.tsx +88 -0
- package/src/web-components/interaction/form/BdsSegmentedControl.mdx +95 -0
- package/src/web-components/interaction/form/BdsSegmentedControl.stories.tsx +102 -0
- package/src/web-components/interaction/form/BdsSelect.mdx +76 -0
- package/src/web-components/interaction/form/BdsSelect.stories.tsx +84 -0
- package/src/web-components/interaction/form/BdsSlider.mdx +77 -0
- package/src/web-components/interaction/form/BdsSlider.stories.tsx +68 -0
- package/src/web-components/interaction/form/BdsSwitch.mdx +72 -0
- package/src/web-components/interaction/form/BdsSwitch.stories.tsx +58 -0
- package/src/web-components/interaction/form/BdsTextarea.mdx +73 -0
- package/src/web-components/interaction/form/BdsTextarea.stories.tsx +70 -0
- package/src/web-components/interaction/form/bds-checkbox-group.spec.ts +55 -0
- package/src/web-components/interaction/form/bds-checkbox-group.ts +117 -0
- package/src/web-components/interaction/form/bds-checkbox.ts +1 -3
- package/src/web-components/interaction/form/bds-combobox.ts +1 -3
- package/src/web-components/interaction/form/bds-form-input.spec.ts +83 -0
- package/src/web-components/interaction/form/bds-form-input.ts +268 -0
- package/src/web-components/interaction/form/bds-number-input.ts +3 -4
- package/src/web-components/interaction/form/bds-radio-group.spec.ts +62 -0
- package/src/web-components/interaction/form/bds-radio-group.ts +142 -0
- package/src/web-components/interaction/form/bds-radio.ts +6 -12
- package/src/web-components/interaction/form/bds-segmented-control.ts +96 -20
- package/src/web-components/interaction/form/bds-select.ts +2 -4
- package/src/web-components/interaction/form/bds-switch.ts +3 -4
- package/src/web-components/interaction/form/bds-textarea.ts +1 -3
- package/src/web-components/ui/BdsAvatar.mdx +76 -0
- package/src/web-components/ui/BdsAvatar.stories.tsx +48 -0
- package/src/web-components/ui/BdsBreadcrumb.mdx +66 -0
- package/src/web-components/ui/BdsBreadcrumb.stories.tsx +49 -0
- package/src/web-components/ui/BdsButtonGroup.mdx +69 -0
- package/src/web-components/ui/BdsButtonGroup.stories.tsx +66 -0
- package/src/web-components/ui/BdsCalendar.mdx +93 -0
- package/src/web-components/ui/BdsCalendar.stories.tsx +63 -0
- package/src/web-components/ui/BdsCard.mdx +88 -0
- package/src/web-components/ui/BdsCard.stories.tsx +67 -0
- package/src/web-components/ui/BdsCarousel.mdx +83 -0
- package/src/web-components/ui/BdsCarousel.stories.tsx +96 -0
- package/src/web-components/ui/BdsDescriptionList.mdx +64 -0
- package/src/web-components/ui/BdsDescriptionList.stories.tsx +64 -0
- package/src/web-components/ui/BdsIconWrapper.mdx +70 -0
- package/src/web-components/ui/BdsIconWrapper.stories.tsx +81 -0
- package/src/web-components/ui/BdsLink.mdx +79 -0
- package/src/web-components/ui/BdsLink.stories.tsx +63 -0
- package/src/web-components/ui/BdsLoading.mdx +58 -0
- package/src/web-components/ui/BdsLoading.stories.tsx +35 -0
- package/src/web-components/ui/BdsNotificationBanner.mdx +85 -0
- package/src/web-components/ui/BdsNotificationBanner.stories.tsx +84 -0
- package/src/web-components/ui/BdsPagination.mdx +74 -0
- package/src/web-components/ui/BdsPagination.stories.tsx +36 -0
- package/src/web-components/ui/BdsProgress.mdx +70 -0
- package/src/web-components/ui/BdsProgress.stories.tsx +96 -0
- package/src/web-components/ui/BdsProgressCircle.mdx +70 -0
- package/src/web-components/ui/BdsProgressCircle.stories.tsx +57 -0
- package/src/web-components/ui/BdsRating.mdx +61 -0
- package/src/web-components/ui/BdsRating.stories.tsx +45 -0
- package/src/web-components/ui/BdsSectionHeader.mdx +72 -0
- package/src/web-components/ui/BdsSectionHeader.stories.tsx +54 -0
- package/src/web-components/ui/BdsSeparator.mdx +77 -0
- package/src/web-components/ui/BdsSeparator.stories.tsx +55 -0
- package/src/web-components/ui/BdsSkeleton.mdx +61 -0
- package/src/web-components/ui/BdsSkeleton.stories.tsx +50 -0
- package/src/web-components/ui/BdsTable.mdx +81 -0
- package/src/web-components/ui/BdsTable.stories.tsx +83 -0
- package/src/web-components/ui/BdsTypography.mdx +74 -0
- package/src/web-components/ui/BdsTypography.stories.tsx +52 -0
- package/src/web-components/ui/bds-alert.ts +1 -2
- package/src/web-components/ui/bds-button-group.spec.ts +40 -0
- package/src/web-components/ui/bds-button-group.ts +78 -0
- package/src/web-components/ui/bds-calendar.spec.ts +91 -0
- package/src/web-components/ui/bds-calendar.ts +427 -0
- package/src/web-components/ui/bds-card.ts +1 -3
- package/src/web-components/ui/bds-carousel.spec.ts +64 -0
- package/src/web-components/ui/bds-carousel.ts +296 -0
- package/src/web-components/ui/bds-notification-banner.ts +1 -2
- package/src/web-components/ui/bds-pagination.spec.ts +67 -0
- package/src/web-components/ui/bds-pagination.ts +197 -0
- package/src/web-components/ui/bds-table.spec.ts +45 -0
- package/src/web-components/ui/bds-table.ts +96 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as lit from 'lit';
|
|
2
2
|
import { LitElement } from 'lit';
|
|
3
3
|
|
|
4
|
-
type ButtonVariant = 'default' | 'ghost';
|
|
4
|
+
type ButtonVariant = 'default' | 'outline' | 'ghost';
|
|
5
5
|
type ButtonSize = 'small' | 'medium' | 'large';
|
|
6
6
|
/**
|
|
7
7
|
* `<bds-button>` — framework-agnostic Button custom element.
|
|
8
8
|
*
|
|
9
9
|
* Attributes:
|
|
10
|
-
* variant — "default" (filled, default) | "
|
|
10
|
+
* variant — "default" (filled, default) | "outline" (transparent + outlined) | "ghost" (deprecated alias for "outline")
|
|
11
11
|
* size — "small" | "medium" (default) | "large"
|
|
12
12
|
* disabled — boolean
|
|
13
13
|
* href — renders an <a> tag instead of <button>
|
|
@@ -5,22 +5,25 @@ interface SegmentedOption {
|
|
|
5
5
|
value: string;
|
|
6
6
|
label: string;
|
|
7
7
|
disabled?: boolean;
|
|
8
|
+
/** When set, renders the option as an <a> link instead of a radio button */
|
|
9
|
+
href?: string;
|
|
8
10
|
}
|
|
9
11
|
/**
|
|
10
12
|
* `<bds-segmented-control>` — form-associated Segmented Control custom element.
|
|
11
13
|
*
|
|
12
|
-
* Renders a group of radio buttons styled as a unified segmented control.
|
|
14
|
+
* Renders a group of radio buttons (or links) styled as a unified segmented control.
|
|
13
15
|
* Passes a JSON `options` attribute because reactive slot content can't be
|
|
14
16
|
* easily converted to radio groups.
|
|
15
17
|
*
|
|
16
18
|
* Attributes:
|
|
17
19
|
* name — form field name (also used for the internal radio group)
|
|
18
20
|
* value — currently selected value
|
|
19
|
-
* options — JSON array of `{ value, label, disabled? }` option objects
|
|
21
|
+
* options — JSON array of `{ value, label, disabled?, href? }` option objects
|
|
20
22
|
* disabled — boolean; disables all options
|
|
23
|
+
* variant — "outline" (inset border on active item, default) | "filled" (sliding thumb)
|
|
21
24
|
*
|
|
22
25
|
* Events:
|
|
23
|
-
* change — fired when a new segment is selected
|
|
26
|
+
* change — fired when a new segment is selected (radio mode only)
|
|
24
27
|
*
|
|
25
28
|
* @example
|
|
26
29
|
* <bds-segmented-control
|
|
@@ -28,6 +31,13 @@ interface SegmentedOption {
|
|
|
28
31
|
* value="list"
|
|
29
32
|
* options='[{"value":"list","label":"List"},{"value":"grid","label":"Grid"}]'
|
|
30
33
|
* ></bds-segmented-control>
|
|
34
|
+
*
|
|
35
|
+
* @example Outline variant with links
|
|
36
|
+
* <bds-segmented-control
|
|
37
|
+
* variant="outline"
|
|
38
|
+
* value="home"
|
|
39
|
+
* options='[{"value":"home","label":"Home","href":"/"},{"value":"about","label":"About","href":"/about"}]'
|
|
40
|
+
* ></bds-segmented-control>
|
|
31
41
|
*/
|
|
32
42
|
declare class BdsSegmentedControl extends LitElement {
|
|
33
43
|
static formAssociated: boolean;
|
|
@@ -47,17 +57,24 @@ declare class BdsSegmentedControl extends LitElement {
|
|
|
47
57
|
type: BooleanConstructor;
|
|
48
58
|
reflect: boolean;
|
|
49
59
|
};
|
|
60
|
+
variant: {
|
|
61
|
+
type: StringConstructor;
|
|
62
|
+
reflect: boolean;
|
|
63
|
+
};
|
|
50
64
|
};
|
|
51
65
|
name: string;
|
|
52
66
|
value: string;
|
|
53
67
|
options: string;
|
|
54
68
|
disabled: boolean;
|
|
69
|
+
variant: 'outline' | 'filled';
|
|
55
70
|
private _internals;
|
|
56
71
|
private readonly _uid;
|
|
57
72
|
constructor();
|
|
58
73
|
private get _options();
|
|
59
74
|
updated(changed: Map<string, unknown>): void;
|
|
75
|
+
private _positionSlider;
|
|
60
76
|
private _updateThumb;
|
|
77
|
+
private _updateIndicator;
|
|
61
78
|
formResetCallback(): void;
|
|
62
79
|
private _handleChange;
|
|
63
80
|
render(): lit.TemplateResult<1>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@boostdev/design-system-components",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "BoostDev React component library: accessible, token-driven components built on @boostdev/design-system-foundation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"React",
|
|
@@ -271,7 +271,7 @@
|
|
|
271
271
|
"typecheck": "tsc --noEmit",
|
|
272
272
|
"lint": "eslint src",
|
|
273
273
|
"lint:css": "stylelint \"src/**/*.css\"",
|
|
274
|
-
"storybook": "storybook dev -p 6006",
|
|
274
|
+
"storybook": "storybook dev -p 6006 --no-manager-cache",
|
|
275
275
|
"build-storybook": "storybook build",
|
|
276
276
|
"test": "vitest run",
|
|
277
277
|
"test:watch": "vitest",
|
|
@@ -13,17 +13,17 @@
|
|
|
13
13
|
@keyframes pulse {
|
|
14
14
|
0% {
|
|
15
15
|
transform: scale(1);
|
|
16
|
-
box-shadow: 0 0 0 0 rgb(from var(--button_pulse-color, var(--button_color, var(--bds-
|
|
16
|
+
box-shadow: 0 0 0 0 rgb(from var(--button_pulse-color, var(--button_color, var(--bds-color_interactive))) r g b / 50%);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
70% {
|
|
20
20
|
transform: scale(1.01);
|
|
21
|
-
box-shadow: 0 0 0 var(--bds-space_m) rgb(from var(--button_pulse-color, var(--button_color, var(--bds-
|
|
21
|
+
box-shadow: 0 0 0 var(--bds-space_m) rgb(from var(--button_pulse-color, var(--button_color, var(--bds-color_interactive))) r g b / 0%);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
100% {
|
|
25
25
|
transform: scale(1);
|
|
26
|
-
box-shadow: 0 0 0 0 rgb(from var(--button_pulse-color, var(--button_color, var(--bds-
|
|
26
|
+
box-shadow: 0 0 0 0 rgb(from var(--button_pulse-color, var(--button_color, var(--bds-color_interactive))) r g b / 0%);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -47,27 +47,27 @@
|
|
|
47
47
|
line-height: 1;
|
|
48
48
|
|
|
49
49
|
/* Colour model: override --button_color + --button_on-color to re-theme */
|
|
50
|
-
--button_color: var(--bds-
|
|
51
|
-
--button_on-color: var(--bds-color_on-
|
|
50
|
+
--button_color: var(--bds-color_interactive);
|
|
51
|
+
--button_on-color: var(--bds-color_on-interactive);
|
|
52
52
|
|
|
53
53
|
/* Text-safe variant of --button_color for use on page background (ghost text/border) */
|
|
54
|
-
--button_color--on-bg: var(--bds-
|
|
54
|
+
--button_color--on-bg: var(--bds-color_interactive_on-bg);
|
|
55
55
|
|
|
56
56
|
background-color: var(--button_bg, var(--button_color));
|
|
57
57
|
color: var(--button_text, var(--button_on-color));
|
|
58
58
|
border: var(--button_border, none);
|
|
59
59
|
--bdc_color: transparent;
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
outline-offset: var(--bdc-outline_offset);
|
|
61
|
+
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color);
|
|
63
62
|
transition: var(--bds-animation_transition), --bdc_color var(--bds-animation_transition-duration) var(--bds-animation_easing);
|
|
64
63
|
}
|
|
65
64
|
|
|
66
65
|
/* Default: filled with --button_color, no visible border */
|
|
67
66
|
.button.--default { /* inherits base — no overrides needed */ }
|
|
68
67
|
|
|
69
|
-
/*
|
|
70
|
-
.button.--
|
|
68
|
+
/* Outline: transparent background, border and text use text-safe --button_color--on-bg */
|
|
69
|
+
.button.--outline,
|
|
70
|
+
.button.--ghost /* @deprecated — use variant="outline" */ {
|
|
71
71
|
--button_bg: transparent;
|
|
72
72
|
--button_text: var(--button_color--on-bg);
|
|
73
73
|
--bdc_color: var(--button_color--on-bg);
|
|
@@ -150,8 +150,9 @@
|
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
/*
|
|
153
|
+
/* Outline hover: fills with --button_color */
|
|
154
154
|
@media (hover: hover) and (pointer: fine) {
|
|
155
|
+
.button.--outline:hover,
|
|
155
156
|
.button.--ghost:hover {
|
|
156
157
|
--button_bg: var(--button_color);
|
|
157
158
|
--button_text: var(--button_on-color);
|
|
@@ -3,7 +3,7 @@ import { StyleSheet, Pressable, Text, View, StyleProp, ViewStyle } from 'react-n
|
|
|
3
3
|
import { spacing, font, border } from '../../../native/tokens';
|
|
4
4
|
import { useTheme } from '../../../native/ThemeContext';
|
|
5
5
|
|
|
6
|
-
type ButtonVariant = 'default' | 'ghost';
|
|
6
|
+
type ButtonVariant = 'default' | 'outline' | 'ghost'; // 'ghost' is deprecated, use 'outline'
|
|
7
7
|
type ButtonSize = 'small' | 'medium' | 'large';
|
|
8
8
|
|
|
9
9
|
export interface ButtonProps {
|
|
@@ -53,26 +53,27 @@ export function Button({
|
|
|
53
53
|
const { colors } = useTheme();
|
|
54
54
|
const { height, px, fontSize, radius } = sizeTokens[size];
|
|
55
55
|
|
|
56
|
-
// Color model: filled =
|
|
57
|
-
const primaryColor = colors.
|
|
58
|
-
const onPrimaryColor = colors.
|
|
59
|
-
//
|
|
60
|
-
const
|
|
56
|
+
// Color model: filled = interactive bg, outline = transparent bg + interactive_on-bg border/text
|
|
57
|
+
const primaryColor = colors.colorInteractive;
|
|
58
|
+
const onPrimaryColor = colors.colorOnInteractive;
|
|
59
|
+
// Outline uses colorInteractiveOnBg for text/border — colorInteractive may not meet 3:1 on white
|
|
60
|
+
const outlineTextColor = colors.colorInteractiveOnBg;
|
|
61
61
|
|
|
62
|
+
const isOutline = variant === 'outline' || variant === 'ghost';
|
|
62
63
|
const containerStyle: ViewStyle = {
|
|
63
64
|
height,
|
|
64
65
|
paddingHorizontal: px,
|
|
65
66
|
borderRadius: radius,
|
|
66
67
|
opacity: disabled ? 0.4 : 1,
|
|
67
68
|
...(variant === 'default' && { backgroundColor: primaryColor }),
|
|
68
|
-
...(
|
|
69
|
+
...(isOutline && {
|
|
69
70
|
backgroundColor: 'transparent',
|
|
70
71
|
borderWidth: 1,
|
|
71
|
-
borderColor:
|
|
72
|
+
borderColor: outlineTextColor,
|
|
72
73
|
}),
|
|
73
74
|
};
|
|
74
75
|
|
|
75
|
-
const textColor = variant === 'default' ? onPrimaryColor :
|
|
76
|
+
const textColor = variant === 'default' ? onPrimaryColor : outlineTextColor;
|
|
76
77
|
|
|
77
78
|
return (
|
|
78
79
|
<Pressable
|
|
@@ -5,7 +5,7 @@ import type { WithClassName } from '../../../types';
|
|
|
5
5
|
|
|
6
6
|
export interface ButtonProps extends WithClassName, ButtonHTMLAttributes<HTMLButtonElement | HTMLAnchorElement> {
|
|
7
7
|
href?: string;
|
|
8
|
-
variant?: 'default' | 'ghost';
|
|
8
|
+
variant?: 'default' | 'outline' | /** @deprecated Use "outline" instead */ 'ghost';
|
|
9
9
|
type?: 'button' | 'submit' | 'reset';
|
|
10
10
|
size?: 'small' | 'medium' | 'large';
|
|
11
11
|
iconStart?: ReactNode;
|
|
@@ -21,15 +21,13 @@
|
|
|
21
21
|
background-color: var(--command_color, var(--bds-color_bg));
|
|
22
22
|
color: var(--command_on-color, var(--bds-color_on-bg));
|
|
23
23
|
border-radius: var(--bds-border_radius--m);
|
|
24
|
-
box-shadow: var(--command_shadow, var(--bds-shadow_xl));
|
|
25
24
|
overflow: hidden;
|
|
26
25
|
max-block-size: 70vh;
|
|
27
26
|
border: var(--command_border, none);
|
|
28
27
|
--bdc_color: currentcolor;
|
|
29
28
|
--bdc-outline_radius: var(--bds-border_radius--m);
|
|
30
29
|
|
|
31
|
-
|
|
32
|
-
outline-offset: var(--bdc-outline_offset);
|
|
30
|
+
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color), var(--command_shadow, var(--bds-shadow_xl));
|
|
33
31
|
}
|
|
34
32
|
|
|
35
33
|
.searchRow {
|
|
@@ -73,8 +71,7 @@
|
|
|
73
71
|
--bdc_color: currentcolor;
|
|
74
72
|
|
|
75
73
|
border: none;
|
|
76
|
-
|
|
77
|
-
outline-offset: var(--bdc-outline_offset);
|
|
74
|
+
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color);
|
|
78
75
|
}
|
|
79
76
|
|
|
80
77
|
.list {
|
|
@@ -132,8 +129,7 @@
|
|
|
132
129
|
--bdc_color: currentcolor;
|
|
133
130
|
|
|
134
131
|
border: none;
|
|
135
|
-
|
|
136
|
-
outline-offset: var(--bdc-outline_offset);
|
|
132
|
+
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color);
|
|
137
133
|
}
|
|
138
134
|
|
|
139
135
|
.empty {
|
|
@@ -5,10 +5,8 @@
|
|
|
5
5
|
--bdc_color: currentcolor;
|
|
6
6
|
--bdc-outline_radius: var(--bds-border_radius--m);
|
|
7
7
|
|
|
8
|
-
outline: var(--bdc-outline_width) solid var(--bdc_color);
|
|
9
|
-
outline-offset: var(--bdc-outline_offset);
|
|
10
8
|
border-radius: var(--dialog_radius, var(--bdc-outline_radius));
|
|
11
|
-
box-shadow: var(--dialog_shadow, var(--bdc-outline_shadow));
|
|
9
|
+
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color), var(--dialog_shadow, var(--bdc-outline_shadow));
|
|
12
10
|
background-color: var(--dialog_color ,var(--bds-color_grey--subtle));
|
|
13
11
|
color: var(--dialog_on-color, var(--bds-color_on-grey--subtle));
|
|
14
12
|
padding: var(--bds-space_l);
|
|
@@ -41,11 +39,15 @@
|
|
|
41
39
|
border: var(--dialog_close-border, none);
|
|
42
40
|
--bdc_color: currentcolor;
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
outline-offset: var(--bdc-outline_offset);
|
|
42
|
+
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color);
|
|
46
43
|
cursor: pointer;
|
|
47
44
|
}
|
|
48
45
|
|
|
46
|
+
.closeButton:focus-visible {
|
|
47
|
+
outline: var(--bds-outline_default);
|
|
48
|
+
outline-offset: var(--bds-outline_offset);
|
|
49
|
+
}
|
|
50
|
+
|
|
49
51
|
.closeButton svg {
|
|
50
52
|
inline-size: 1.25em;
|
|
51
53
|
block-size: 1.25em;
|
|
@@ -1,43 +1,65 @@
|
|
|
1
1
|
@layer component {
|
|
2
2
|
.drawer {
|
|
3
3
|
position: fixed;
|
|
4
|
-
inset: 0;
|
|
4
|
+
inset-block: 0;
|
|
5
|
+
inset-inline: auto 0;
|
|
6
|
+
inline-size: min(28rem, 90vw);
|
|
7
|
+
max-inline-size: 100vw;
|
|
8
|
+
block-size: 100dvh;
|
|
9
|
+
max-block-size: 100dvh;
|
|
5
10
|
margin: 0;
|
|
6
11
|
padding: 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
background-color: var(--drawer_color, var(--bds-color_bg));
|
|
15
|
+
color: var(--drawer_on-color, var(--bds-color_on-bg));
|
|
11
16
|
border: none;
|
|
12
|
-
|
|
17
|
+
box-shadow: var(--bds-shadow_xl);
|
|
13
18
|
overflow: hidden;
|
|
19
|
+
translate: 100% 0;
|
|
20
|
+
transition:
|
|
21
|
+
translate var(--bds-animation_transition-duration) var(--bds-animation_easing),
|
|
22
|
+
display var(--bds-animation_transition-duration) var(--bds-animation_easing) allow-discrete,
|
|
23
|
+
overlay var(--bds-animation_transition-duration) var(--bds-animation_easing) allow-discrete;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.--side_left.drawer {
|
|
27
|
+
inset-inline: 0 auto;
|
|
28
|
+
translate: -100% 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.drawer[open] {
|
|
32
|
+
translate: 0 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@starting-style {
|
|
36
|
+
.drawer[open] {
|
|
37
|
+
translate: 100% 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.--side_left.drawer[open] {
|
|
41
|
+
translate: -100% 0;
|
|
42
|
+
}
|
|
14
43
|
}
|
|
15
44
|
|
|
16
45
|
.drawer::backdrop {
|
|
17
46
|
background-color: var(--color_backdrop, rgb(0 0 0 / 50%));
|
|
18
47
|
backdrop-filter: blur(3px);
|
|
48
|
+
opacity: 0;
|
|
49
|
+
transition:
|
|
50
|
+
opacity var(--bds-animation_transition-duration) var(--bds-animation_easing),
|
|
51
|
+
display var(--bds-animation_transition-duration) var(--bds-animation_easing) allow-discrete,
|
|
52
|
+
overlay var(--bds-animation_transition-duration) var(--bds-animation_easing) allow-discrete;
|
|
19
53
|
}
|
|
20
54
|
|
|
21
|
-
.
|
|
22
|
-
|
|
23
|
-
inset-block: 0;
|
|
24
|
-
display: flex;
|
|
25
|
-
flex-direction: column;
|
|
26
|
-
inline-size: min(28rem, 90vw);
|
|
27
|
-
block-size: 100%;
|
|
28
|
-
background-color: var(--drawer_color, var(--bds-color_bg));
|
|
29
|
-
color: var(--drawer_on-color, var(--bds-color_on-bg));
|
|
30
|
-
box-shadow: var(--bds-shadow_xl);
|
|
31
|
-
overflow: hidden;
|
|
32
|
-
transition: var(--bds-animation_transition);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.--side_right .panel {
|
|
36
|
-
inset-inline-end: 0;
|
|
55
|
+
.drawer[open]::backdrop {
|
|
56
|
+
opacity: 1;
|
|
37
57
|
}
|
|
38
58
|
|
|
39
|
-
|
|
40
|
-
|
|
59
|
+
@starting-style {
|
|
60
|
+
.drawer[open]::backdrop {
|
|
61
|
+
opacity: 0;
|
|
62
|
+
}
|
|
41
63
|
}
|
|
42
64
|
|
|
43
65
|
.header {
|
|
@@ -86,7 +108,8 @@
|
|
|
86
108
|
}
|
|
87
109
|
|
|
88
110
|
@media (prefers-reduced-motion: reduce) {
|
|
89
|
-
.
|
|
111
|
+
.drawer,
|
|
112
|
+
.drawer::backdrop {
|
|
90
113
|
transition: none;
|
|
91
114
|
}
|
|
92
115
|
}
|
|
@@ -75,7 +75,13 @@ export function Drawer({
|
|
|
75
75
|
|
|
76
76
|
// Close on backdrop click
|
|
77
77
|
const handleClick = (e: React.MouseEvent<HTMLDialogElement>) => {
|
|
78
|
-
|
|
78
|
+
const dialog = dialogRef.current;
|
|
79
|
+
if (!dialog) return;
|
|
80
|
+
const rect = dialog.getBoundingClientRect();
|
|
81
|
+
const outside =
|
|
82
|
+
e.clientX < rect.left || e.clientX > rect.right ||
|
|
83
|
+
e.clientY < rect.top || e.clientY > rect.bottom;
|
|
84
|
+
if (outside) onClose();
|
|
79
85
|
};
|
|
80
86
|
|
|
81
87
|
// Close on Escape (dialog handles it natively, but we sync state)
|
|
@@ -94,23 +100,21 @@ export function Drawer({
|
|
|
94
100
|
onClick={handleClick}
|
|
95
101
|
onCancel={handleCancel}
|
|
96
102
|
>
|
|
97
|
-
<div className={css.
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
>
|
|
107
|
-
<
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
</button>
|
|
111
|
-
</div>
|
|
112
|
-
<div className={css.body}>{children}</div>
|
|
103
|
+
<div className={css.header}>
|
|
104
|
+
{!!title && title}
|
|
105
|
+
<button
|
|
106
|
+
type="button"
|
|
107
|
+
className={css.closeButton}
|
|
108
|
+
commandfor={id}
|
|
109
|
+
command="close"
|
|
110
|
+
aria-label="Close drawer"
|
|
111
|
+
>
|
|
112
|
+
<svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
|
113
|
+
<path strokeLinecap="round" strokeLinejoin="round" d="M18 6L6 18M6 6l12 12" />
|
|
114
|
+
</svg>
|
|
115
|
+
</button>
|
|
113
116
|
</div>
|
|
117
|
+
<div className={css.body}>{children}</div>
|
|
114
118
|
</dialog>
|
|
115
119
|
);
|
|
116
120
|
}
|
|
@@ -14,12 +14,10 @@
|
|
|
14
14
|
--bdc_color: currentcolor;
|
|
15
15
|
--bdc-outline_radius: var(--bds-border_radius--s);
|
|
16
16
|
|
|
17
|
-
outline: var(--bdc-outline_width) solid var(--bdc_color);
|
|
18
|
-
outline-offset: var(--bdc-outline_offset);
|
|
19
17
|
border-radius: var(--dropdown_radius, var(--bdc-outline_radius));
|
|
20
18
|
background-color: var(--dropdown_color, var(--bds-color_bg));
|
|
21
19
|
color: var(--dropdown_on-color, var(--bds-color_on-bg));
|
|
22
|
-
box-shadow: var(--dropdown_shadow, var(--bds-shadow_m));
|
|
20
|
+
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color), var(--dropdown_shadow, var(--bds-shadow_m));
|
|
23
21
|
list-style: none;
|
|
24
22
|
margin: 0;
|
|
25
23
|
}
|
|
@@ -25,11 +25,9 @@
|
|
|
25
25
|
--bdc_color: currentcolor;
|
|
26
26
|
--bdc-outline_radius: var(--bds-border_radius--s);
|
|
27
27
|
|
|
28
|
-
outline: var(--bdc-outline_width) solid var(--bdc_color);
|
|
29
|
-
outline-offset: var(--bdc-outline_offset);
|
|
30
28
|
border-radius: var(--popover_radius, var(--bdc-outline_radius));
|
|
31
29
|
background-color: var(--popover_color, var(--bds-color_bg));
|
|
32
|
-
box-shadow: var(--popover_shadow, var(--bds-shadow_m));
|
|
30
|
+
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color), var(--popover_shadow, var(--bds-shadow_m));
|
|
33
31
|
color: var(--popover_on-color, var(--bds-color_on-bg));
|
|
34
32
|
font-size: var(--bds-font_size--body);
|
|
35
33
|
}
|
|
@@ -21,10 +21,8 @@
|
|
|
21
21
|
--bdc_color: currentcolor;
|
|
22
22
|
--bdc-outline_radius: var(--bds-border_radius--xs);
|
|
23
23
|
|
|
24
|
-
outline: var(--bdc-outline_width) solid var(--bdc_color);
|
|
25
|
-
outline-offset: var(--bdc-outline_offset);
|
|
26
24
|
border-radius: var(--checkbox_radius, var(--bdc-outline_radius));
|
|
27
|
-
box-shadow: var(--checkbox_shadow, var(--bdc-outline_shadow));
|
|
25
|
+
box-shadow: inset 0 0 0 var(--bdc-outline_width) var(--bdc_color), var(--checkbox_shadow, var(--bdc-outline_shadow));
|
|
28
26
|
appearance: none;
|
|
29
27
|
background-color: var(--checkbox_color_bg, var(--bds-color_bg));
|
|
30
28
|
cursor: pointer;
|