@kcascend/liquid-ui 0.0.8 → 0.0.9
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/README.md +66 -66
- package/dist/components/Icon/icons.d.ts +1 -0
- package/dist/components/Icon/icons.d.ts.map +1 -1
- package/dist/components/Icon/icons.js +1 -0
- package/dist/components/Link/Link.js +2 -2
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Modal/Modal.js +2 -1
- package/dist/generated/tokens.d.ts +1772 -55
- package/dist/generated/tokens.d.ts.map +1 -1
- package/dist/generated/tokens.js +2836 -1119
- package/dist/governance/checkboxGovernance.js +2 -2
- package/dist/governance/linkGovernance.js +2 -2
- package/dist/governance/modalGovernance.js +2 -2
- package/dist/styles.css +3763 -3775
- package/dist/tokens/components.css +1 -1
- package/dist/tokens/primitives.css +4 -0
- package/dist/tokens/semantic.css +21 -13
- package/package.json +37 -33
package/README.md
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
# Liquid UI Package
|
|
2
|
-
|
|
3
|
-
`@kcascend/liquid-ui` is the reusable UI package for Liquid Design System consumers.
|
|
4
|
-
|
|
5
|
-
## Local development
|
|
6
|
-
|
|
7
|
-
1. Run `npm install` from the repository root to install the local file dependency.
|
|
8
|
-
2. Run `npm run build:ui` to rebuild the package outputs in `packages/liquid-ui/dist`.
|
|
9
|
-
3. Run `npm run storybook` to rebuild the package and launch Storybook against the package boundary.
|
|
10
|
-
|
|
11
|
-
## Grid usage
|
|
12
|
-
|
|
13
|
-
The package exposes a grid primitive through `GridLayout` and `GridColumn`, plus an approved layout catalog for application shells and content regions.
|
|
14
|
-
|
|
15
|
-
```tsx
|
|
16
|
-
import {
|
|
17
|
-
approvedContentLayoutPatterns,
|
|
18
|
-
GridColumn,
|
|
19
|
-
GridLayout,
|
|
20
|
-
} from '@kcascend/liquid-ui';
|
|
21
|
-
|
|
22
|
-
export function Example() {
|
|
23
|
-
const layout = approvedContentLayoutPatterns.sidebarEnd;
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<GridLayout as="div">
|
|
27
|
-
<GridColumn {...layout.regions.primary}>Primary</GridColumn>
|
|
28
|
-
<GridColumn {...layout.regions.secondary}>Secondary</GridColumn>
|
|
29
|
-
</GridLayout>
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
Supported layout features:
|
|
35
|
-
|
|
36
|
-
- Responsive spans through `sm`, `md`, `lg`, `xlg`, and `max`.
|
|
37
|
-
- Offset columns with object values like `md={{ span: 4, offset: 2 }}`.
|
|
38
|
-
- Gutter modes with `narrow` and `condensed`.
|
|
39
|
-
- `withRowGap` to keep vertical spacing aligned with the active gutter.
|
|
40
|
-
- `fullWidth` for viewport-spanning layouts.
|
|
41
|
-
- `subgrid` for nested grids that inherit the parent column scaffold.
|
|
42
|
-
- Auto columns when a `GridColumn` is rendered without explicit breakpoint props.
|
|
43
|
-
|
|
44
|
-
Approved layout guidance:
|
|
45
|
-
|
|
46
|
-
- Start application shells from `approvedShellRows`.
|
|
47
|
-
- Start page content from `approvedContentLayoutPatterns`.
|
|
48
|
-
- Introduce a bespoke breakpoint map only when a screen cannot be expressed by the approved patterns and that exception is documented in a spec.
|
|
49
|
-
|
|
50
|
-
## Figma governance
|
|
51
|
-
|
|
52
|
-
Every reusable component must record an approved Figma reference in story metadata or component documentation before it is considered ready for review. The initial workflow example in this package uses the Liquid token source in Figma
|
|
53
|
-
|
|
54
|
-
Storybook now demonstrates both patterns:
|
|
55
|
-
|
|
56
|
-
- a package-consumed button component with Figma and accessibility metadata
|
|
57
|
-
- a token values reference story that reads directly from the generated `tokens` export
|
|
58
|
-
|
|
59
|
-
## Accessibility verification
|
|
60
|
-
|
|
61
|
-
Each component review must include:
|
|
62
|
-
|
|
63
|
-
- Keyboard interaction expectations when the component is interactive.
|
|
64
|
-
- Name, role, and state guidance for assistive technologies.
|
|
65
|
-
- Color contrast and focus treatment verification.
|
|
66
|
-
- Storybook documentation that explains any usage constraints needed to stay WCAG 2.1 aligned.
|
|
1
|
+
# Liquid UI Package
|
|
2
|
+
|
|
3
|
+
`@kcascend/liquid-ui` is the reusable UI package for Liquid Design System consumers.
|
|
4
|
+
|
|
5
|
+
## Local development
|
|
6
|
+
|
|
7
|
+
1. Run `npm install` from the repository root to install the local file dependency.
|
|
8
|
+
2. Run `npm run build:ui` to rebuild the package outputs in `packages/liquid-ui/dist`.
|
|
9
|
+
3. Run `npm run storybook` to rebuild the package and launch Storybook against the package boundary.
|
|
10
|
+
|
|
11
|
+
## Grid usage
|
|
12
|
+
|
|
13
|
+
The package exposes a grid primitive through `GridLayout` and `GridColumn`, plus an approved layout catalog for application shells and content regions.
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import {
|
|
17
|
+
approvedContentLayoutPatterns,
|
|
18
|
+
GridColumn,
|
|
19
|
+
GridLayout,
|
|
20
|
+
} from '@kcascend/liquid-ui';
|
|
21
|
+
|
|
22
|
+
export function Example() {
|
|
23
|
+
const layout = approvedContentLayoutPatterns.sidebarEnd;
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<GridLayout as="div">
|
|
27
|
+
<GridColumn {...layout.regions.primary}>Primary</GridColumn>
|
|
28
|
+
<GridColumn {...layout.regions.secondary}>Secondary</GridColumn>
|
|
29
|
+
</GridLayout>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Supported layout features:
|
|
35
|
+
|
|
36
|
+
- Responsive spans through `sm`, `md`, `lg`, `xlg`, and `max`.
|
|
37
|
+
- Offset columns with object values like `md={{ span: 4, offset: 2 }}`.
|
|
38
|
+
- Gutter modes with `narrow` and `condensed`.
|
|
39
|
+
- `withRowGap` to keep vertical spacing aligned with the active gutter.
|
|
40
|
+
- `fullWidth` for viewport-spanning layouts.
|
|
41
|
+
- `subgrid` for nested grids that inherit the parent column scaffold.
|
|
42
|
+
- Auto columns when a `GridColumn` is rendered without explicit breakpoint props.
|
|
43
|
+
|
|
44
|
+
Approved layout guidance:
|
|
45
|
+
|
|
46
|
+
- Start application shells from `approvedShellRows`.
|
|
47
|
+
- Start page content from `approvedContentLayoutPatterns`.
|
|
48
|
+
- Introduce a bespoke breakpoint map only when a screen cannot be expressed by the approved patterns and that exception is documented in a spec.
|
|
49
|
+
|
|
50
|
+
## Figma governance
|
|
51
|
+
|
|
52
|
+
Every reusable component must record an approved Figma reference in story metadata or component documentation before it is considered ready for review. The initial workflow example in this package uses the Liquid token source in Figma
|
|
53
|
+
|
|
54
|
+
Storybook now demonstrates both patterns:
|
|
55
|
+
|
|
56
|
+
- a package-consumed button component with Figma and accessibility metadata
|
|
57
|
+
- a token values reference story that reads directly from the generated `tokens` export
|
|
58
|
+
|
|
59
|
+
## Accessibility verification
|
|
60
|
+
|
|
61
|
+
Each component review must include:
|
|
62
|
+
|
|
63
|
+
- Keyboard interaction expectations when the component is interactive.
|
|
64
|
+
- Name, role, and state guidance for assistive technologies.
|
|
65
|
+
- Color contrast and focus treatment verification.
|
|
66
|
+
- Storybook documentation that explains any usage constraints needed to stay WCAG 2.1 aligned.
|
|
@@ -7,6 +7,7 @@ export declare const icons: {
|
|
|
7
7
|
arrow_up: import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
arrow_down: import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
arrow_right: import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
arrow_forward: import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
arrow_left: import("react/jsx-runtime").JSX.Element;
|
|
11
12
|
chevron_down: import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
check: import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/icons.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/icons.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;CA6PjB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,KAAK,CAAC"}
|
|
@@ -8,6 +8,7 @@ export const icons = {
|
|
|
8
8
|
arrow_up: (_jsxs("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M12 19V5", stroke: "currentColor", strokeWidth: "2" }), _jsx("path", { d: "M5 12l7-7 7 7", stroke: "currentColor", strokeWidth: "2", fill: "none" })] })),
|
|
9
9
|
arrow_down: (_jsxs("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M12 5v14", stroke: "currentColor", strokeWidth: "2" }), _jsx("path", { d: "M19 12l-7 7-7-7", stroke: "currentColor", strokeWidth: "2", fill: "none" })] })),
|
|
10
10
|
arrow_right: (_jsx("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M9.5 17V7L14.5 12L9.5 17Z", fill: "currentColor" }) })),
|
|
11
|
+
arrow_forward: (_jsx("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M4 12H20M14 6L20 12L14 18", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "square", strokeLinejoin: "miter" }) })),
|
|
11
12
|
arrow_left: (_jsx("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M14.5 17L9.5 12L14.5 7V17Z", fill: "currentColor" }) })),
|
|
12
13
|
chevron_down: (_jsx("svg", { viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M5 8L10 13L15 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })),
|
|
13
14
|
check: (_jsx("svg", { viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M2 8.5L6.5 13L14 3.5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })),
|
|
@@ -16,8 +16,8 @@ export function Link(props) {
|
|
|
16
16
|
const iconSize = size === 'lg' ? 20 : 16;
|
|
17
17
|
if ('href' in props && props.href) {
|
|
18
18
|
const { appearance: _appearance, children: _children, className: _className, href, showTrailingIcon: _showTrailingIcon, size: _size, state: _state, style: _style, ...anchorProps } = props;
|
|
19
|
-
return (_jsxs("a", { ...anchorProps, className: getClassName(className), "data-appearance": appearance, "data-size": size, "data-state": state, href: href, style: style, children: [_jsx("span", { className: "liquid-link__label", children: children }), showIcon ? (_jsx("span", { "aria-hidden": "true", className: "liquid-link__icon", children: _jsx(Icon, { name: "
|
|
19
|
+
return (_jsxs("a", { ...anchorProps, className: getClassName(className), "data-appearance": appearance, "data-size": size, "data-state": state, href: href, style: style, children: [_jsx("span", { className: "liquid-link__label", children: children }), showIcon ? (_jsx("span", { "aria-hidden": "true", className: "liquid-link__icon", children: _jsx(Icon, { name: "arrow_forward", size: iconSize }) })) : null] }));
|
|
20
20
|
}
|
|
21
21
|
const { appearance: _appearance, children: _children, className: _className, showTrailingIcon: _showTrailingIcon, size: _size, state: _state, style: _style, ...buttonProps } = props;
|
|
22
|
-
return (_jsxs("button", { ...buttonProps, className: getClassName(className), "data-appearance": appearance, "data-size": size, "data-state": state, style: style, type: buttonProps.type ?? 'button', children: [_jsx("span", { className: "liquid-link__label", children: children }), showIcon ? (_jsx("span", { "aria-hidden": "true", className: "liquid-link__icon", children: _jsx(Icon, { name: "
|
|
22
|
+
return (_jsxs("button", { ...buttonProps, className: getClassName(className), "data-appearance": appearance, "data-size": size, "data-state": state, style: style, type: buttonProps.type ?? 'button', children: [_jsx("span", { className: "liquid-link__label", children: children }), showIcon ? (_jsx("span", { "aria-hidden": "true", className: "liquid-link__icon", children: _jsx(Icon, { name: "arrow_forward", size: iconSize }) })) : null] }));
|
|
23
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/Modal.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAoC,UAAU,EAAE,MAAM,aAAa,CAAC;AA6BhF,wBAAgB,KAAK,CAAC,EACpB,QAAQ,EACR,SAAS,EACT,gBAAiC,EACjC,WAAuN,EACvN,YAAY,EACZ,KAAwB,EACxB,OAAO,EACP,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,kBAA8B,EAC9B,oBAAoB,EACpB,oBAA+B,EAC/B,eAAsB,EACtB,UAAU,EACV,KAAK,EACL,mBAAqC,EACrC,KAAe,EACf,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/Modal.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAoC,UAAU,EAAE,MAAM,aAAa,CAAC;AA6BhF,wBAAgB,KAAK,CAAC,EACpB,QAAQ,EACR,SAAS,EACT,gBAAiC,EACjC,WAAuN,EACvN,YAAY,EACZ,KAAwB,EACxB,OAAO,EACP,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,kBAA8B,EAC9B,oBAAoB,EACpB,oBAA+B,EAC/B,eAAsB,EACtB,UAAU,EACV,KAAK,EACL,mBAAqC,EACrC,KAAe,EACf,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,UAAU,2CA8GZ"}
|
|
@@ -23,5 +23,6 @@ export function Modal({ children, className, closeButtonLabel = 'Close dialog',
|
|
|
23
23
|
const resolvedFooterLayout = footerLayout ?? getDefaultFooterLayout(tone);
|
|
24
24
|
const resolvedShowFooter = showFooter ?? tone !== 'passive';
|
|
25
25
|
const resolvedPrimaryVariant = getPrimaryVariant(tone, primaryActionVariant);
|
|
26
|
-
|
|
26
|
+
const resolvedDescription = description ?? label;
|
|
27
|
+
return (_jsxs("section", { ...props, className: getClassName(className), "data-footer-layout": resolvedFooterLayout, "data-tone": tone, style: style, children: [_jsxs("header", { className: "liquid-modal__header", children: [_jsxs("div", { className: "liquid-modal__header-content", children: [resolvedDescription ? (_jsx("p", { className: "liquid-modal__description", children: resolvedDescription })) : null, _jsx("h2", { className: "liquid-modal__title", children: title })] }), showCloseButton ? (_jsx("button", { "aria-label": closeButtonLabel, className: "liquid-modal__close", onClick: onClose, type: "button", children: _jsx(Icon, { className: "liquid-modal__close-icon", name: "close", size: 24 }) })) : null] }), _jsx("div", { className: "liquid-modal__content", children: children ? _jsx("div", { className: "liquid-modal__body", children: children }) : null }), resolvedShowFooter ? (_jsx("footer", { className: "liquid-modal__footer", children: _jsxs("div", { className: "liquid-modal__actions", children: [resolvedFooterLayout === 'single' ? (_jsx("div", { className: "liquid-modal__actions-single", children: _jsx(Button, { className: "liquid-modal__action liquid-modal__action--single", onClick: onPrimaryAction, size: "lg", variant: resolvedPrimaryVariant, children: primaryActionLabel }) })) : null, resolvedFooterLayout === 'double' ? (_jsxs("div", { className: "liquid-modal__actions-double", children: [_jsx(Button, { className: "liquid-modal__action", onClick: onPrimaryAction, size: "lg", variant: resolvedPrimaryVariant, children: primaryActionLabel }), _jsx(Button, { className: "liquid-modal__action", onClick: onSecondaryAction, size: "lg", variant: "secondary", children: secondaryActionLabel })] })) : null, resolvedFooterLayout === 'split' ? (_jsxs("div", { className: "liquid-modal__actions-split", children: [_jsxs("div", { className: "liquid-modal__actions-left", children: [_jsx(Button, { className: "liquid-modal__action", onClick: onPrimaryAction, size: "lg", variant: resolvedPrimaryVariant, children: primaryActionLabel }), _jsx(Button, { className: "liquid-modal__action", onClick: onSecondaryAction, size: "lg", variant: "secondary", children: secondaryActionLabel })] }), _jsx(Button, { className: "liquid-modal__action liquid-modal__action--option", onClick: onTertiaryAction, size: "lg", variant: "tertiary", children: tertiaryActionLabel })] })) : null] }) })) : null] }));
|
|
27
28
|
}
|