@sebgroup/green-core 2.35.1 → 2.36.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/components/button/button.trans.styles.scss.js +1 -1
- package/components/calendar/calendar.trans.styles.scss.js +1 -1
- package/components/context-menu/context-menu.trans.styles.scss.js +1 -1
- package/components/datepicker/datepicker.trans.styles.scss.js +1 -1
- package/components/dialog/dialog.component.d.ts +22 -2
- package/components/dialog/dialog.component.js +104 -23
- package/components/formatted-text/date/date-time-formatter.js +1 -3
- package/components/grouped-list/grouped-list.trans.styles.scss.js +1 -1
- package/components/pagination/pagination.component.js +11 -8
- package/components/popover/popover.trans.styles.scss.js +1 -1
- package/components/segmented-control/segment/segment.trans.styles.scss.js +1 -1
- package/components/segmented-control/segmented-control.trans.styles.css.js +1 -1
- package/components/table/table.component.d.ts +16 -1
- package/components/table/table.component.js +116 -190
- package/components/table/table.stories.data.d.ts +25 -47
- package/components/table/table.stories.data.js +261 -288
- package/components/table/table.styles.js +15 -2
- package/components/table/table.types.d.ts +16 -81
- package/components/table/table.types.js +40 -10
- package/components/theme/chlorophyll-tokens.scss.js +1 -1
- package/custom-elements.json +20809 -20571
- package/gds-element.js +1 -1
- package/generated/mcp/components.json +1 -1
- package/generated/mcp/dialog/api.md +8 -4
- package/generated/mcp/icons.json +1 -1
- package/generated/mcp/index.json +1 -1
- package/generated/mcp/table/api.md +2 -1
- package/generated/react/dialog/index.d.ts +2 -1
- package/generated/react/index.d.ts +1 -1
- package/generated/react/index.js +1 -1
- package/generated/react/table/index.d.ts +2 -1
- package/package.json +1 -1
- package/primitives/field-base/field-base.trans.styles.scss.js +1 -1
- package/primitives/listbox/listbox.trans.styles.scss.js +1 -1
- package/primitives/listbox/option.trans.styles.scss.js +1 -1
- package/primitives/menu/menu-heading.trans.styles.scss.js +1 -1
- package/utils/helpers/custom-element-scoping.js +1 -1
- package/utils/helpers/id.d.ts +0 -3
- package/utils/helpers/id.js +6 -1
package/gds-element.js
CHANGED
|
@@ -12,7 +12,7 @@ class GdsElement extends LitElement {
|
|
|
12
12
|
/**
|
|
13
13
|
* The semantic version of this element. Can be used for troubleshooting to verify the version being used.
|
|
14
14
|
*/
|
|
15
|
-
this.semanticVersion = "2.
|
|
15
|
+
this.semanticVersion = "2.36.0";
|
|
16
16
|
this._isUsingTransitionalStyles = false;
|
|
17
17
|
this._dynamicStylesController = new DynamicStylesController(this);
|
|
18
18
|
}
|
|
@@ -9,11 +9,12 @@
|
|
|
9
9
|
|
|
10
10
|
| Name | Type | Default | Description |
|
|
11
11
|
|------|------|---------|-------------|
|
|
12
|
-
| `open` | `boolean` | `-` | Whether the dialog is open. The state of the dialog can be controlled either by setting this property or by calling the `show()` and `close()` methods. |
|
|
12
|
+
| `open` | `boolean` | `-` | Whether the dialog is open. The state of the dialog can be controlled either by setting this property or by calling the `show()` and `close()` methods. When the state is explicitly changed by setting this prop, the state change cannot be cancelled by events. |
|
|
13
13
|
| `heading` | `string \| undefined` | `-` | The dialog's heading. |
|
|
14
14
|
| `variant` | `'default' \| 'slide-out'` | `-` | The dialog's variant. |
|
|
15
15
|
| `placement` | `'initial' \| 'top' \| 'bottom' \| 'left' \| 'right'` | `-` | The dialog's placement. |
|
|
16
16
|
| `scrollable` | `boolean` | `-` | Whether the inner content of the dialog should have scrollable overflow. Scroll will appear if the content exceeds the dialog's height, which can be controlled using the `height` property. This property have no effect if the `dialog` slot is used. In that case, you need to add overflow styles to the content inside the `dialog` slot. |
|
|
17
|
+
| `closedby` | `'closerequest' \| 'none' \| 'any'` | `-` | Controls which user actions can close the dialog. Maps to the native `<dialog>` `closedby` attribute. - `closerequest` (default): The dialog can be dismissed by platform close gestures (Escape key, iOS swipe, etc.). The browser's anti-abuse mechanism applies: after one cancelled close request, subsequent cancellations require a user activation in between. This ensures the best mobile UX. - `none`: The dialog can only be closed by developer-specified mechanisms (buttons, click outside, or programmatic API). A manual Escape key listener is added for desktop users, with fully cancellable behavior (no anti-abuse limit). Mobile platform close gestures may not work in this mode. - `any`: The dialog can also be dismissed by light dismiss (clicking outside). Note that gds-dialog already handles click-outside via its own mechanism. |
|
|
17
18
|
| `width` | `string \| undefined` | `-` | Style Expression Property that controls the `width` property. Supports space tokens and all valid CSS `width` values. |
|
|
18
19
|
| `'min-width'` | `string \| undefined` | `-` | Style Expression Property that controls the `min-width` property. Supports space tokens and all valid CSS `min-width` values. |
|
|
19
20
|
| `'max-width'` | `string \| undefined` | `-` | Style Expression Property that controls the `max-width` property. Supports space tokens and all valid CSS `max-width` values. |
|
|
@@ -55,16 +56,19 @@
|
|
|
55
56
|
### `show(reason?: string): void`
|
|
56
57
|
|
|
57
58
|
Opens the dialog.
|
|
59
|
+
This is a programmatic API that always opens the dialog.
|
|
60
|
+
Events are dispatched for notification when a reason is provided, but cancellation is not honored.
|
|
58
61
|
|
|
59
62
|
**Parameters:**
|
|
60
63
|
|
|
61
64
|
- `reason`: `string` _(optional)_
|
|
62
65
|
|
|
63
|
-
### `close(reason
|
|
66
|
+
### `close(reason?: string): void`
|
|
64
67
|
|
|
65
68
|
Closes the dialog.
|
|
69
|
+
This is a programmatic API that always closes the dialog.
|
|
70
|
+
Events are dispatched for notification when a reason is provided, but cancellation is not honored.
|
|
66
71
|
|
|
67
72
|
**Parameters:**
|
|
68
73
|
|
|
69
|
-
- `reason`: `string`
|
|
70
|
-
- `returnValue`: `any`
|
|
74
|
+
- `reason`: `string` _(optional)_
|
package/generated/mcp/icons.json
CHANGED
package/generated/mcp/index.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
| `data` | `(request: Types.Request) => Promise<Types.Response<T>>` | `-` | Asynchronous data provider function. Accepts: function that returns Promise with rows and total count |
|
|
21
21
|
| `density` | `Types.Density` | `-` | Controls row density. Accepts: `comfortable`, `compact`, `spacious` |
|
|
22
22
|
| `selectable` | `boolean` | `-` | Enables row selection functionality. |
|
|
23
|
+
| `disableSelectAll` | `boolean` | `-` | Disables select all checkbox in header. |
|
|
23
24
|
| `responsive` | `boolean` | `-` | Transforms table layout for mobile screens. |
|
|
24
25
|
| `plain` | `boolean` | `-` | Removes table header and footer. |
|
|
25
26
|
| `searchable` | `boolean` | `-` | Adds search input for data filtering. |
|
|
@@ -39,7 +40,7 @@
|
|
|
39
40
|
| `gds-page-change` | `CustomEvent<any>` | Fired when the active page changes. Detail: `{ page: number }` |
|
|
40
41
|
| `gds-rows-change` | `CustomEvent<any>` | Fired when the rows per page value changes. Detail: `{ rows: number }` |
|
|
41
42
|
| `gds-sort-change` | `CustomEvent<any>` | Fired when sorting changes. Detail: `{ sortColumn: string, sortDirection: 'asc' \| 'desc' }` |
|
|
42
|
-
| `gds-table-data-loaded` | `CustomEvent<any>` | Fired when data is successfully loaded. |
|
|
43
|
+
| `gds-table-data-loaded` | `CustomEvent<any>` | Fired when data is successfully loaded. Detail: `{ rows: T[], total: number, page: number, rowsPerPage: number, searchQuery: string, sortColumn?: string, sortDirection?: 'asc' \| 'desc' }` |
|
|
43
44
|
| `gds-table-data-error` | `CustomEvent<any>` | Fired when data loading fails. |
|
|
44
45
|
| `gds-table-selection` | `CustomEvent<any>` | Fired when row selection changes. |
|
|
45
46
|
|
|
@@ -17,8 +17,9 @@ export declare const GdsDialog: {
|
|
|
17
17
|
variant?: "default" | "slide-out" | undefined;
|
|
18
18
|
placement?: "top" | "right" | "bottom" | "left" | "initial" | undefined;
|
|
19
19
|
scrollable?: boolean | undefined;
|
|
20
|
+
closedby?: "none" | "closerequest" | "any" | undefined;
|
|
20
21
|
show?: ((reason?: string) => void) | undefined;
|
|
21
|
-
close?: ((reason
|
|
22
|
+
close?: ((reason?: string) => void) | undefined;
|
|
22
23
|
disconnectedCallback?: (() => void) | undefined;
|
|
23
24
|
render?: (() => any) | undefined;
|
|
24
25
|
width?: string | undefined;
|
|
@@ -390,8 +390,8 @@ export * from './icons/icon-zoom-in/index.js';
|
|
|
390
390
|
export * from './icons/icon-zoom-out/index.js';
|
|
391
391
|
export * from './radio-group/index.js';
|
|
392
392
|
export * from './segment/index.js';
|
|
393
|
-
export * from './sensitive-account/index.js';
|
|
394
393
|
export * from './sensitive-date/index.js';
|
|
394
|
+
export * from './sensitive-account/index.js';
|
|
395
395
|
export * from './sensitive-number/index.js';
|
|
396
396
|
export * from './menu-item/index.js';
|
|
397
397
|
export * from './menu-heading/index.js';
|
package/generated/react/index.js
CHANGED
|
@@ -390,8 +390,8 @@ export * from "./icons/icon-zoom-in/index.js";
|
|
|
390
390
|
export * from "./icons/icon-zoom-out/index.js";
|
|
391
391
|
export * from "./radio-group/index.js";
|
|
392
392
|
export * from "./segment/index.js";
|
|
393
|
-
export * from "./sensitive-account/index.js";
|
|
394
393
|
export * from "./sensitive-date/index.js";
|
|
394
|
+
export * from "./sensitive-account/index.js";
|
|
395
395
|
export * from "./sensitive-number/index.js";
|
|
396
396
|
export * from "./menu-item/index.js";
|
|
397
397
|
export * from "./menu-heading/index.js";
|
|
@@ -7,7 +7,7 @@ type GdsTableProps = React.ComponentProps<ReturnType<typeof getReactComponent<Gd
|
|
|
7
7
|
onGdsRowsChange?: (event: CustomEvent<any>) => void;
|
|
8
8
|
/** Fired when sorting changes. Detail: `{ sortColumn: string, sortDirection: 'asc' | 'desc' }` */
|
|
9
9
|
onGdsSortChange?: (event: CustomEvent<any>) => void;
|
|
10
|
-
/** Fired when data is successfully loaded. */
|
|
10
|
+
/** Fired when data is successfully loaded. Detail: `{ rows: T[], total: number, page: number, rowsPerPage: number, searchQuery: string, sortColumn?: string, sortDirection?: 'asc' | 'desc' }` */
|
|
11
11
|
onGdsTableDataLoaded?: (event: CustomEvent<any>) => void;
|
|
12
12
|
/** Fired when data loading fails. */
|
|
13
13
|
onGdsTableDataError?: (event: CustomEvent<any>) => void;
|
|
@@ -29,6 +29,7 @@ export declare const GdsTable: {
|
|
|
29
29
|
data?: ((request: import("../../../components/table/table.types").Request) => Promise<import("../../../components/table/table.types").Response<import("../../../components/table/table.types").Row>>) | undefined;
|
|
30
30
|
density?: import("../../../components/table/table.types").Density | undefined;
|
|
31
31
|
selectable?: boolean | undefined;
|
|
32
|
+
disableSelectAll?: boolean | undefined;
|
|
32
33
|
responsive?: boolean | undefined;
|
|
33
34
|
plain?: boolean | undefined;
|
|
34
35
|
searchable?: boolean | undefined;
|
package/package.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const styles = "/* stylelint-disable max-nesting-depth */\n/* stylelint-enable max-nesting-depth */\n/**\n * Calculate the luminance for a color.\n *
|
|
1
|
+
const styles = "/* stylelint-disable max-nesting-depth */\n/**\n * Assert that a map is in ascending order\n * @mixin assert-ascending\n * @param {Map} $map - The map to check\n * @param {String} $map-name - The name of the map\n */\n/**\n * Assert that the first breakpoint in a map starts at zero\n * @mixin assert-starts-at-zero\n * @param {Map} $map - The map to check\n * @param {String} $map-name - The name of the map\n */\n/**\n * Check if a value is important\n * @function is-important\n * @param {Boolean} $important - Whether the value is important\n * @return {String} - \"!important\" if true, otherwise an empty string\n */\n/**\n * Replace a substring in a string\n * @function str-replace\n * @param {String} $string - The original string\n * @param {String} $search - The substring to replace\n * @param {String} $replace - The replacement string\n * @return {String} - The updated string\n */\n/**\n * Convert a map to its negative variant\n * @function negativify-map\n * @param {Map} $map - The map to convert\n * @return {Map} - The negative variant of the map\n */\n/**\n * Generate utility classes\n * @mixin generate-utility\n * @param {Map} $utility - Utility map\n * @param {String} $infix - Infix for class names\n * @param {Boolean} $is-rfs-media-query - Whether to use RFS media query\n */\n/* stylelint-enable max-nesting-depth */\n/**\n * Calculate the luminance for a color.\n * @function luminance\n * @param {Color} $color - The color to calculate luminance for\n * @return {Number} - The luminance value\n */\n/**\n * Calculate the contrast ratio between two colors.\n * @function color-contrast\n * @param {Color} $fg - Foreground color\n * @param {Color} $bg - Background color\n * @return {Number} - The contrast ratio\n */\n/**\n * Remove the unit of a length\n * @function strip-unit\n * @param {Number} $number - Number to remove unit from\n * @return {Number} - Unitless number\n */\n/**\n * Validate font size\n * @function validate-font-size\n * @param {Number} $size - Font size to validate\n * @return {Number} - Validated font size in pixels\n */\n/**\n * Get ratio for WCAG level\n * @function get-ratio\n * @param {String} $level - WCAG level\n * @param {Number} $size - Font size\n * @param {Boolean} $bold - Is bold\n * @param {Boolean} $graphic - Is graphic\n * @return {Number} - Ratio value\n */\n/**\n * Determine if a color is light or dark\n * @function light-or-dark\n * @param {Color} $color - The color to check\n * @return {String} - \"light\" or \"dark\"\n */\n/**\n * Get the most legible color (black or white) for a given background color\n * @function most-legible-color\n * @param {Color} $color - The background color\n * @return {Color} - The most legible color\n */\n/**\n * Get the desired color combination for foreground and background colors\n * @function desired-color-combination\n * @param {Color} $fg - Foreground color\n * @param {Color} $bg - Background color\n * @param {Number} $offsetThreshold - Offset threshold\n * @param {Number} $ratio - Contrast ratio\n * @return {List} - List containing background and foreground colors\n */\n/**\n * @mixin desired-color-combination\n * @param {Color} $fg - Foreground color\n * @param {Color} $bg - Background color\n * @param {Number} $offsetThreshold - Offset threshold\n * @param {Number} $ratio - Contrast ratio\n */\n/**\n * Get an accessible color for a given foreground and background color\n * @function a11y-color\n * @param {Color} $fg - Foreground color\n * @param {Color} $bg - Background color\n * @param {String} $level - WCAG level\n * @param {Number} $size - Font size\n * @param {Boolean} $bold - Is bold\n * @param {Boolean} $graphic - Is graphic\n * @param {Number} $maxOffset - Maximum offset\n * @param {Boolean} $darkMode - Is dark mode\n * @param {Number} $ratio - Contrast ratio\n * @return {Color} - Accessible color\n */\n/**\n * Get the maximum contrast color\n * @function max-contrast\n * @param {Color} $fg - Foreground color\n * @param {Color} $bg - Background color\n * @param {Color} $max - Maximum contrast color\n * @return {Color} - Maximum contrast color\n */\n/**\n * Get the RGB values of a color as a string\n * @function stripped-rgb\n * @param {Color} $color - The color\n * @return {String} - RGB values as a string\n */\n/**\n * Get the HSL values of a color as a string\n * @function stripped-hsl\n * @param {Color} $color - The color\n * @return {String} - HSL values as a string\n */\n/**\n * Convert a map of colors to a map of HSL values\n * @function hsl-map\n * @param {Map} $colors - Map of colors\n * @return {Map} - Map of HSL values\n */\n/**\n* @deprecated\n* Use `add-focus` instead\n*/\n/** add background color, color and border-color to element when it has focus-visible i.e. tab focus */\n/**\n * Breakpoint viewport sizes and media queries.\n *\n * Breakpoints are defined as a map of (name: minimum width), order from small to large:\n *\n * (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px)\n *\n * The map defined in the `$grid-breakpoints` global variable is used as the `$breakpoints` argument by default.\n */\n/**\n * Name of the next breakpoint, or null for the last breakpoint.\n *\n * >> breakpoint-next(sm)\n * md\n * >> breakpoint-next(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n * md\n * >> breakpoint-next(sm, $breakpoint-names: (xs sm md lg xl))\n * md\n */\n/**\n * Minimum breakpoint width. Null for the smallest (first) breakpoint.\n *\n * >> breakpoint-min(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n * 576px\n */\n/**\n * Maximum breakpoint width.\n * The maximum value is reduced by 0.02px to work around the limitations of\n * `min-` and `max-` prefixes and viewports with fractional widths.\n * See https://www.w3.org/TR/mediaqueries-4/#mq-min-max\n * Uses 0.02px rather than 0.01px to work around a current rounding bug in Safari.\n * See https://bugs.webkit.org/show_bug.cgi?id=178261\n *\n * >> breakpoint-max(md, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n * 767.98px\n */\n/**\n * Returns a blank string if smallest breakpoint, otherwise returns the name with a dash in front.\n * Useful for making responsive utilities.\n *\n * >> breakpoint-infix(xs, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n * \"\" (Returns a blank string)\n * >> breakpoint-infix(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n * \"-sm\"\n */\n/**\n * Media of at least the minimum breakpoint width. No query for the smallest breakpoint.\n * Makes the @content apply to the given breakpoint and wider.\n */\n/**\n * Media of at most the maximum breakpoint width. No query for the largest breakpoint.\n * Makes the @content apply to the given breakpoint and narrower.\n */\n/**\n * Media that spans multiple breakpoint widths.\n * Makes the @content apply between the min and max breakpoints\n */\n/**\n * Media between the breakpoint's minimum and maximum widths.\n * No minimum for the smallest breakpoint, and no maximum for the largest one.\n * Makes the @content apply only to the given breakpoint, not viewports any wider or narrower.\n */\n@layer base, reset, transitional-styles;\n@layer transitional-styles {\n .field {\n border-radius: 0.25rem;\n border: solid 1px var(--gds-sys-color-base-600);\n --border-color: var(--gds-sys-color-base-600);\n }\n .field:focus:not(:focus-visible) {\n box-shadow: none;\n outline: 0;\n }\n .field:focus, .field:focus-within {\n outline-color: var(--gds-sys-color-focus-outline);\n outline-style: solid;\n outline-width: 0.125rem;\n outline-offset: 0.125rem;\n }\n .field {\n align-items: stretch;\n gap: var(--gds-sys-space-xs);\n background-color: var(--gds-sys-color-background-primary);\n box-sizing: border-box;\n color: var(--gds-sys-color-text-primary);\n cursor: text;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: calc(var(--gds-sys-space-xs) - 1px) var(--gds-sys-space-xs) calc(var(--gds-sys-space-xs) - 1px) var(--gds-sys-space-m);\n min-block-size: 44px;\n }\n .field:hover {\n background-color: var(--grey-200);\n }\n .field.small {\n font-size: 0.875rem;\n min-height: 2rem;\n }\n .field.multiline {\n align-items: flex-start;\n padding: calc(var(--gds-sys-space-s) - 1px) var(--gds-sys-space-s) calc(var(--gds-sys-space-s) - 1px) var(--gds-sys-space-m);\n height: -moz-max-content;\n height: max-content;\n }\n .field.action-slot-occupied:not(.trail-slot-occupied) {\n padding-right: var(--gds-sys-space-xs);\n }\n .field.lead-slot-occupied {\n padding-left: var(--gds-sys-space-xs);\n }\n .field.trail-slot-occupied {\n padding: calc(var(--gds-sys-space-xs) - 1px) var(--gds-sys-space-m);\n }\n .field slot[name=action]::slotted(*) {\n margin: -3px 0 -3px -3px;\n }\n .field:focus-within {\n outline-color: currentColor;\n }\n .field.invalid {\n border-color: var(--gds-sys-color-border-negative-01);\n color: var(--gds-sys-color-content-negative-01);\n border-bottom-width: 2px;\n }\n .field.disabled {\n background: var(--gds-sys-color-l3-disabled-01);\n color: var(--gds-sys-color-content-disabled-01);\n border-color: transparent;\n pointer-events: none;\n }\n .main-slot-wrap {\n display: flex;\n flex: 1;\n }\n slot:not([name])::slotted(*) {\n color: currentColor;\n }\n slot[name=lead]::slotted([gds-element^=gds-icon-]) {\n align-items: center;\n justify-content: center;\n display: flex;\n min-width: var(--gds-sys-space-l);\n }\n}";
|
|
2
2
|
export default styles;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const styles = "/**\n * Calculate the luminance for a color.\n *
|
|
1
|
+
const styles = "/* stylelint-disable max-nesting-depth */\n/**\n * Assert that a map is in ascending order\n * @mixin assert-ascending\n * @param {Map} $map - The map to check\n * @param {String} $map-name - The name of the map\n */\n/**\n * Assert that the first breakpoint in a map starts at zero\n * @mixin assert-starts-at-zero\n * @param {Map} $map - The map to check\n * @param {String} $map-name - The name of the map\n */\n/**\n * Check if a value is important\n * @function is-important\n * @param {Boolean} $important - Whether the value is important\n * @return {String} - \"!important\" if true, otherwise an empty string\n */\n/**\n * Replace a substring in a string\n * @function str-replace\n * @param {String} $string - The original string\n * @param {String} $search - The substring to replace\n * @param {String} $replace - The replacement string\n * @return {String} - The updated string\n */\n/**\n * Convert a map to its negative variant\n * @function negativify-map\n * @param {Map} $map - The map to convert\n * @return {Map} - The negative variant of the map\n */\n/**\n * Generate utility classes\n * @mixin generate-utility\n * @param {Map} $utility - Utility map\n * @param {String} $infix - Infix for class names\n * @param {Boolean} $is-rfs-media-query - Whether to use RFS media query\n */\n/* stylelint-enable max-nesting-depth */\n/**\n * Calculate the luminance for a color.\n * @function luminance\n * @param {Color} $color - The color to calculate luminance for\n * @return {Number} - The luminance value\n */\n/**\n * Calculate the contrast ratio between two colors.\n * @function color-contrast\n * @param {Color} $fg - Foreground color\n * @param {Color} $bg - Background color\n * @return {Number} - The contrast ratio\n */\n/**\n * Remove the unit of a length\n * @function strip-unit\n * @param {Number} $number - Number to remove unit from\n * @return {Number} - Unitless number\n */\n/**\n * Validate font size\n * @function validate-font-size\n * @param {Number} $size - Font size to validate\n * @return {Number} - Validated font size in pixels\n */\n/**\n * Get ratio for WCAG level\n * @function get-ratio\n * @param {String} $level - WCAG level\n * @param {Number} $size - Font size\n * @param {Boolean} $bold - Is bold\n * @param {Boolean} $graphic - Is graphic\n * @return {Number} - Ratio value\n */\n/**\n * Determine if a color is light or dark\n * @function light-or-dark\n * @param {Color} $color - The color to check\n * @return {String} - \"light\" or \"dark\"\n */\n/**\n * Get the most legible color (black or white) for a given background color\n * @function most-legible-color\n * @param {Color} $color - The background color\n * @return {Color} - The most legible color\n */\n/**\n * Get the desired color combination for foreground and background colors\n * @function desired-color-combination\n * @param {Color} $fg - Foreground color\n * @param {Color} $bg - Background color\n * @param {Number} $offsetThreshold - Offset threshold\n * @param {Number} $ratio - Contrast ratio\n * @return {List} - List containing background and foreground colors\n */\n/**\n * @mixin desired-color-combination\n * @param {Color} $fg - Foreground color\n * @param {Color} $bg - Background color\n * @param {Number} $offsetThreshold - Offset threshold\n * @param {Number} $ratio - Contrast ratio\n */\n/**\n * Get an accessible color for a given foreground and background color\n * @function a11y-color\n * @param {Color} $fg - Foreground color\n * @param {Color} $bg - Background color\n * @param {String} $level - WCAG level\n * @param {Number} $size - Font size\n * @param {Boolean} $bold - Is bold\n * @param {Boolean} $graphic - Is graphic\n * @param {Number} $maxOffset - Maximum offset\n * @param {Boolean} $darkMode - Is dark mode\n * @param {Number} $ratio - Contrast ratio\n * @return {Color} - Accessible color\n */\n/**\n * Get the maximum contrast color\n * @function max-contrast\n * @param {Color} $fg - Foreground color\n * @param {Color} $bg - Background color\n * @param {Color} $max - Maximum contrast color\n * @return {Color} - Maximum contrast color\n */\n/**\n * Get the RGB values of a color as a string\n * @function stripped-rgb\n * @param {Color} $color - The color\n * @return {String} - RGB values as a string\n */\n/**\n * Get the HSL values of a color as a string\n * @function stripped-hsl\n * @param {Color} $color - The color\n * @return {String} - HSL values as a string\n */\n/**\n * Convert a map of colors to a map of HSL values\n * @function hsl-map\n * @param {Map} $colors - Map of colors\n * @return {Map} - Map of HSL values\n */\n/**\n* @deprecated\n* Use `add-focus` instead\n*/\n/** add background color, color and border-color to element when it has focus-visible i.e. tab focus */\n/**\n * Breakpoint viewport sizes and media queries.\n *\n * Breakpoints are defined as a map of (name: minimum width), order from small to large:\n *\n * (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px)\n *\n * The map defined in the `$grid-breakpoints` global variable is used as the `$breakpoints` argument by default.\n */\n/**\n * Name of the next breakpoint, or null for the last breakpoint.\n *\n * >> breakpoint-next(sm)\n * md\n * >> breakpoint-next(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n * md\n * >> breakpoint-next(sm, $breakpoint-names: (xs sm md lg xl))\n * md\n */\n/**\n * Minimum breakpoint width. Null for the smallest (first) breakpoint.\n *\n * >> breakpoint-min(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n * 576px\n */\n/**\n * Maximum breakpoint width.\n * The maximum value is reduced by 0.02px to work around the limitations of\n * `min-` and `max-` prefixes and viewports with fractional widths.\n * See https://www.w3.org/TR/mediaqueries-4/#mq-min-max\n * Uses 0.02px rather than 0.01px to work around a current rounding bug in Safari.\n * See https://bugs.webkit.org/show_bug.cgi?id=178261\n *\n * >> breakpoint-max(md, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n * 767.98px\n */\n/**\n * Returns a blank string if smallest breakpoint, otherwise returns the name with a dash in front.\n * Useful for making responsive utilities.\n *\n * >> breakpoint-infix(xs, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n * \"\" (Returns a blank string)\n * >> breakpoint-infix(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n * \"-sm\"\n */\n/**\n * Media of at least the minimum breakpoint width. No query for the smallest breakpoint.\n * Makes the @content apply to the given breakpoint and wider.\n */\n/**\n * Media of at most the maximum breakpoint width. No query for the largest breakpoint.\n * Makes the @content apply to the given breakpoint and narrower.\n */\n/**\n * Media that spans multiple breakpoint widths.\n * Makes the @content apply between the min and max breakpoints\n */\n/**\n * Media between the breakpoint's minimum and maximum widths.\n * No minimum for the smallest breakpoint, and no maximum for the largest one.\n * Makes the @content apply only to the given breakpoint, not viewports any wider or narrower.\n */\n/** \n * @deprecated in favor of Grouped list component\n */\n/** \n * @deprecated in favor of Grouped list component\n */\n@layer base, reset, transitional-styles;\n@layer transitional-styles {\n :host {\n padding-left: 0;\n margin-bottom: 0;\n margin-top: 0;\n display: flex;\n flex-direction: column;\n list-style: none;\n }\n :host > li {\n padding-bottom: 0.5rem;\n padding-top: 0.5rem;\n border: 0;\n display: block;\n position: relative;\n }\n :host > li::before {\n font-weight: 500;\n display: inline-block;\n left: 0;\n position: absolute;\n text-align: center;\n }\n :host {\n overflow-y: auto;\n }\n}";
|
|
2
2
|
export default styles;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const styles = "/**\n * Calculate the luminance for a color.\n *
|
|
1
|
+
const styles = "/* stylelint-disable max-nesting-depth */\n/**\n * Assert that a map is in ascending order\n * @mixin assert-ascending\n * @param {Map} $map - The map to check\n * @param {String} $map-name - The name of the map\n */\n/**\n * Assert that the first breakpoint in a map starts at zero\n * @mixin assert-starts-at-zero\n * @param {Map} $map - The map to check\n * @param {String} $map-name - The name of the map\n */\n/**\n * Check if a value is important\n * @function is-important\n * @param {Boolean} $important - Whether the value is important\n * @return {String} - \"!important\" if true, otherwise an empty string\n */\n/**\n * Replace a substring in a string\n * @function str-replace\n * @param {String} $string - The original string\n * @param {String} $search - The substring to replace\n * @param {String} $replace - The replacement string\n * @return {String} - The updated string\n */\n/**\n * Convert a map to its negative variant\n * @function negativify-map\n * @param {Map} $map - The map to convert\n * @return {Map} - The negative variant of the map\n */\n/**\n * Generate utility classes\n * @mixin generate-utility\n * @param {Map} $utility - Utility map\n * @param {String} $infix - Infix for class names\n * @param {Boolean} $is-rfs-media-query - Whether to use RFS media query\n */\n/* stylelint-enable max-nesting-depth */\n/**\n * Calculate the luminance for a color.\n * @function luminance\n * @param {Color} $color - The color to calculate luminance for\n * @return {Number} - The luminance value\n */\n/**\n * Calculate the contrast ratio between two colors.\n * @function color-contrast\n * @param {Color} $fg - Foreground color\n * @param {Color} $bg - Background color\n * @return {Number} - The contrast ratio\n */\n/**\n * Remove the unit of a length\n * @function strip-unit\n * @param {Number} $number - Number to remove unit from\n * @return {Number} - Unitless number\n */\n/**\n * Validate font size\n * @function validate-font-size\n * @param {Number} $size - Font size to validate\n * @return {Number} - Validated font size in pixels\n */\n/**\n * Get ratio for WCAG level\n * @function get-ratio\n * @param {String} $level - WCAG level\n * @param {Number} $size - Font size\n * @param {Boolean} $bold - Is bold\n * @param {Boolean} $graphic - Is graphic\n * @return {Number} - Ratio value\n */\n/**\n * Determine if a color is light or dark\n * @function light-or-dark\n * @param {Color} $color - The color to check\n * @return {String} - \"light\" or \"dark\"\n */\n/**\n * Get the most legible color (black or white) for a given background color\n * @function most-legible-color\n * @param {Color} $color - The background color\n * @return {Color} - The most legible color\n */\n/**\n * Get the desired color combination for foreground and background colors\n * @function desired-color-combination\n * @param {Color} $fg - Foreground color\n * @param {Color} $bg - Background color\n * @param {Number} $offsetThreshold - Offset threshold\n * @param {Number} $ratio - Contrast ratio\n * @return {List} - List containing background and foreground colors\n */\n/**\n * @mixin desired-color-combination\n * @param {Color} $fg - Foreground color\n * @param {Color} $bg - Background color\n * @param {Number} $offsetThreshold - Offset threshold\n * @param {Number} $ratio - Contrast ratio\n */\n/**\n * Get an accessible color for a given foreground and background color\n * @function a11y-color\n * @param {Color} $fg - Foreground color\n * @param {Color} $bg - Background color\n * @param {String} $level - WCAG level\n * @param {Number} $size - Font size\n * @param {Boolean} $bold - Is bold\n * @param {Boolean} $graphic - Is graphic\n * @param {Number} $maxOffset - Maximum offset\n * @param {Boolean} $darkMode - Is dark mode\n * @param {Number} $ratio - Contrast ratio\n * @return {Color} - Accessible color\n */\n/**\n * Get the maximum contrast color\n * @function max-contrast\n * @param {Color} $fg - Foreground color\n * @param {Color} $bg - Background color\n * @param {Color} $max - Maximum contrast color\n * @return {Color} - Maximum contrast color\n */\n/**\n * Get the RGB values of a color as a string\n * @function stripped-rgb\n * @param {Color} $color - The color\n * @return {String} - RGB values as a string\n */\n/**\n * Get the HSL values of a color as a string\n * @function stripped-hsl\n * @param {Color} $color - The color\n * @return {String} - HSL values as a string\n */\n/**\n * Convert a map of colors to a map of HSL values\n * @function hsl-map\n * @param {Map} $colors - Map of colors\n * @return {Map} - Map of HSL values\n */\n/**\n* @deprecated\n* Use `add-focus` instead\n*/\n/** add background color, color and border-color to element when it has focus-visible i.e. tab focus */\n/**\n * Breakpoint viewport sizes and media queries.\n *\n * Breakpoints are defined as a map of (name: minimum width), order from small to large:\n *\n * (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px)\n *\n * The map defined in the `$grid-breakpoints` global variable is used as the `$breakpoints` argument by default.\n */\n/**\n * Name of the next breakpoint, or null for the last breakpoint.\n *\n * >> breakpoint-next(sm)\n * md\n * >> breakpoint-next(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n * md\n * >> breakpoint-next(sm, $breakpoint-names: (xs sm md lg xl))\n * md\n */\n/**\n * Minimum breakpoint width. Null for the smallest (first) breakpoint.\n *\n * >> breakpoint-min(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n * 576px\n */\n/**\n * Maximum breakpoint width.\n * The maximum value is reduced by 0.02px to work around the limitations of\n * `min-` and `max-` prefixes and viewports with fractional widths.\n * See https://www.w3.org/TR/mediaqueries-4/#mq-min-max\n * Uses 0.02px rather than 0.01px to work around a current rounding bug in Safari.\n * See https://bugs.webkit.org/show_bug.cgi?id=178261\n *\n * >> breakpoint-max(md, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n * 767.98px\n */\n/**\n * Returns a blank string if smallest breakpoint, otherwise returns the name with a dash in front.\n * Useful for making responsive utilities.\n *\n * >> breakpoint-infix(xs, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n * \"\" (Returns a blank string)\n * >> breakpoint-infix(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n * \"-sm\"\n */\n/**\n * Media of at least the minimum breakpoint width. No query for the smallest breakpoint.\n * Makes the @content apply to the given breakpoint and wider.\n */\n/**\n * Media of at most the maximum breakpoint width. No query for the largest breakpoint.\n * Makes the @content apply to the given breakpoint and narrower.\n */\n/**\n * Media that spans multiple breakpoint widths.\n * Makes the @content apply between the min and max breakpoints\n */\n/**\n * Media between the breakpoint's minimum and maximum widths.\n * No minimum for the smallest breakpoint, and no maximum for the largest one.\n * Makes the @content apply only to the given breakpoint, not viewports any wider or narrower.\n */\n@layer base, reset, transitional-styles;\n@layer transitional-styles {\n .item {\n padding-left: 1rem;\n padding-right: 1rem;\n padding-bottom: 0.75rem;\n padding-top: 0.75rem;\n line-height: 1.25;\n cursor: pointer;\n }\n .item:hover, .item:focus-visible {\n background-color: var(--gds-sys-color-base-200);\n }\n .item:active {\n background-color: var(--gds-sys-color-base-200);\n }\n .item:focus {\n outline-color: #000;\n outline-offset: -0.25rem;\n }\n .item.active.sg-highlighted, .item[aria-selected=true] {\n background: var(--gds-sys-color-base-800);\n color: #fff;\n }\n .item {\n display: flex;\n gap: 0.75rem;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n }\n :host(:hover) div,\n :host(:focus-visible) div {\n background-color: var(--gds-sys-color-base-200);\n }\n :host(:active) div {\n background-color: var(--gds-sys-color-base-300);\n }\n :host(:focus-visible) {\n outline-color: #000;\n outline-offset: -0.25rem;\n }\n :host([inert]) {\n display: none;\n }\n :host([highlighted]) .item {\n background: var(--gds-sys-color-base-800);\n color: #fff;\n }\n}";
|
|
2
2
|
export default styles;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const styles = "@layer base, reset, transitional-styles;\n@layer transitional-styles {\n :host {\n background-color: var(--gds-
|
|
1
|
+
const styles = "@layer base, reset, transitional-styles;\n@layer transitional-styles {\n :host {\n background-color: var(--gds-sys-color-base-300);\n color: var(--gds-sys-color-base-800);\n display: flex;\n font-size: 0.875rem;\n font-weight: 500;\n padding: 0.75rem 1rem;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n }\n :host([aria-hidden=true]) {\n display: none;\n }\n}";
|
|
2
2
|
export default styles;
|
package/utils/helpers/id.d.ts
CHANGED
package/utils/helpers/id.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import "../../chunks/chunk.QU3DSPNU.js";
|
|
2
|
-
const randomId = () =>
|
|
2
|
+
const randomId = () => {
|
|
3
|
+
const array = new Uint32Array(2);
|
|
4
|
+
window.crypto.getRandomValues(array);
|
|
5
|
+
const id = (array[0].toString(36) + array[1].toString(36)).substring(0, 7);
|
|
6
|
+
return "gds-" + id;
|
|
7
|
+
};
|
|
3
8
|
export {
|
|
4
9
|
randomId
|
|
5
10
|
};
|