@kcascend/liquid-ui 0.0.8 → 0.0.10

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.
Files changed (40) hide show
  1. package/README.md +66 -66
  2. package/dist/components/HeaderShell/HeaderShell.d.ts +2 -2
  3. package/dist/components/HeaderShell/HeaderShell.d.ts.map +1 -1
  4. package/dist/components/HeaderShell/HeaderShell.js +60 -20
  5. package/dist/components/Icon/icons.d.ts +1 -0
  6. package/dist/components/Icon/icons.d.ts.map +1 -1
  7. package/dist/components/Icon/icons.js +1 -0
  8. package/dist/components/Link/Link.js +2 -2
  9. package/dist/components/Loading/Loading.d.ts +3 -0
  10. package/dist/components/Loading/Loading.d.ts.map +1 -0
  11. package/dist/components/Loading/Loading.js +7 -0
  12. package/dist/components/LoadingInline/LoadingInline.d.ts +3 -0
  13. package/dist/components/LoadingInline/LoadingInline.d.ts.map +1 -0
  14. package/dist/components/LoadingInline/LoadingInline.js +15 -0
  15. package/dist/components/Modal/Modal.d.ts.map +1 -1
  16. package/dist/components/Modal/Modal.js +2 -1
  17. package/dist/generated/tokens.d.ts +1906 -55
  18. package/dist/generated/tokens.d.ts.map +1 -1
  19. package/dist/generated/tokens.js +2976 -1125
  20. package/dist/governance/checkboxGovernance.js +2 -2
  21. package/dist/governance/headerShellGovernance.d.ts.map +1 -1
  22. package/dist/governance/headerShellGovernance.js +4 -0
  23. package/dist/governance/linkGovernance.js +2 -2
  24. package/dist/governance/loadingGovernance.d.ts +3 -0
  25. package/dist/governance/loadingGovernance.d.ts.map +1 -0
  26. package/dist/governance/loadingGovernance.js +11 -0
  27. package/dist/governance/loadingInlineGovernance.d.ts +3 -0
  28. package/dist/governance/loadingInlineGovernance.d.ts.map +1 -0
  29. package/dist/governance/loadingInlineGovernance.js +12 -0
  30. package/dist/governance/modalGovernance.js +2 -2
  31. package/dist/index.d.ts +5 -1
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +4 -0
  34. package/dist/styles.css +3972 -3775
  35. package/dist/tokens/components.css +29 -1
  36. package/dist/tokens/primitives.css +4 -0
  37. package/dist/tokens/semantic.css +21 -13
  38. package/dist/types.d.ts +17 -0
  39. package/dist/types.d.ts.map +1 -1
  40. 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.
@@ -1,3 +1,3 @@
1
- import type { HeaderShellProps } from "../../types";
2
- export declare function HeaderShell({ activeNavigationItemId, actions, brand, className, defaultActiveNavigationItemId, menuTriggerLabel, navigationItems, navLabel, onAction, onMenuTriggerClick, onNavigationChange, showMenuTrigger, style, ...props }: HeaderShellProps): import("react/jsx-runtime").JSX.Element;
1
+ import type { HeaderShellProps } from '../../types';
2
+ export declare function HeaderShell({ activeNavigationItemId, actions, brand, className, defaultActiveNavigationItemId, menuTriggerLabel, navigationItems, navLabel, onAction, onMenuTriggerClick, onNavigationChange, showMenuTrigger, showNav, showUtilities, style, ...props }: HeaderShellProps): import("react/jsx-runtime").JSX.Element;
3
3
  //# sourceMappingURL=HeaderShell.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"HeaderShell.d.ts","sourceRoot":"","sources":["../../../src/components/HeaderShell/HeaderShell.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,gBAAgB,EAGjB,MAAM,aAAa,CAAC;AA2HrB,wBAAgB,WAAW,CAAC,EAC1B,sBAAsB,EACtB,OAAO,EACP,KAAK,EACL,SAAS,EACT,6BAA6B,EAC7B,gBAA8B,EAC9B,eAAe,EACf,QAAoB,EACpB,QAAQ,EACR,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,KAAK,EACL,GAAG,KAAK,EACT,EAAE,gBAAgB,2CAgMlB"}
1
+ {"version":3,"file":"HeaderShell.d.ts","sourceRoot":"","sources":["../../../src/components/HeaderShell/HeaderShell.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,gBAAgB,EAGjB,MAAM,aAAa,CAAC;AA2KrB,wBAAgB,WAAW,CAAC,EAC1B,sBAAsB,EACtB,OAAO,EACP,KAAK,EACL,SAAS,EACT,6BAA6B,EAC7B,gBAA8B,EAC9B,eAAe,EACf,QAAoB,EACpB,QAAQ,EACR,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,OAAc,EACd,aAAoB,EACpB,KAAK,EACL,GAAG,KAAK,EACT,EAAE,gBAAgB,2CA+OlB"}
@@ -1,33 +1,41 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useEffect, useId, useMemo, useState } from "react";
3
- import { Icon } from "../Icon/Icon";
2
+ import { useEffect, useId, useMemo, useRef, useState } from 'react';
3
+ import { Icon } from '../Icon/Icon';
4
4
  function getClassName(className) {
5
- return ["liquid-header-shell", className].filter(Boolean).join(" ");
5
+ return ['liquid-header-shell', className].filter(Boolean).join(' ');
6
6
  }
7
7
  function getFirstEnabledNavigationItem(items) {
8
8
  return items?.find((item) => !item.disabled)?.id;
9
9
  }
10
10
  function HeaderNavigationLink({ activeItemId, item, onSelect, }) {
11
11
  const isSelected = item.id === activeItemId;
12
+ const isSubmenu = item.type === 'submenu';
13
+ const submenuId = useId();
14
+ const [isSubmenuOpen, setIsSubmenuOpen] = useState(false);
15
+ if (isSubmenu) {
16
+ return (_jsxs("div", { className: "liquid-header-shell__submenu", children: [_jsxs("button", { "aria-controls": submenuId, "aria-expanded": isSubmenuOpen, "aria-haspopup": "menu", className: "liquid-header-shell__nav-link liquid-header-shell__submenu-trigger", "data-selected": isSelected ? 'true' : undefined, "data-submenu-trigger": "true", disabled: item.disabled, onClick: () => {
17
+ setIsSubmenuOpen((current) => !current);
18
+ }, type: "button", children: [_jsx("span", { children: item.label }), _jsx(Icon, { "aria-hidden": "true", name: "chevron_down", size: 16 })] }), isSubmenuOpen && item.submenuItems?.length ? (_jsx("div", { className: "liquid-header-shell__submenu-panel", id: submenuId, role: "menu", children: item.submenuItems.map((submenuItem) => (_jsx(HeaderNavigationLink, { activeItemId: activeItemId, item: submenuItem, onSelect: onSelect }, submenuItem.id))) })) : null] }));
19
+ }
12
20
  if (item.href) {
13
- return (_jsx("a", { className: "liquid-header-shell__nav-link", "data-selected": isSelected ? "true" : undefined, href: item.href, onClick: (event) => {
21
+ return (_jsx("a", { className: "liquid-header-shell__nav-link", "data-selected": isSelected ? 'true' : undefined, href: item.href, onClick: (event) => {
14
22
  if (item.disabled) {
15
23
  event.preventDefault();
16
24
  return;
17
25
  }
18
26
  onSelect(item);
19
- }, "aria-current": isSelected ? "page" : undefined, "aria-disabled": item.disabled ? true : undefined, children: item.label }));
27
+ }, "aria-current": isSelected ? 'page' : undefined, "aria-disabled": item.disabled ? true : undefined, children: item.label }));
20
28
  }
21
- return (_jsx("button", { className: "liquid-header-shell__nav-link", "data-selected": isSelected ? "true" : undefined, disabled: item.disabled, onClick: () => {
29
+ return (_jsx("button", { className: "liquid-header-shell__nav-link", "data-selected": isSelected ? 'true' : undefined, disabled: item.disabled, onClick: () => {
22
30
  if (!item.disabled) {
23
31
  onSelect(item);
24
32
  }
25
- }, type: "button", "aria-current": isSelected ? "page" : undefined, children: item.label }));
33
+ }, type: "button", "aria-current": isSelected ? 'page' : undefined, children: item.label }));
26
34
  }
27
35
  function HeaderUtilityAction({ action, showLabel = false, onAction, }) {
28
- const icon = _jsx(Icon, { name: action.icon, size: action.iconSize ?? 20 });
36
+ const icon = _jsx(Icon, { name: action.icon, size: action.iconSize ?? 24 });
29
37
  if (action.href) {
30
- return (_jsxs("a", { "aria-label": action.label, className: "liquid-header-shell__action", href: action.href, onClick: (event) => {
38
+ return (_jsxs("a", { "aria-label": action.label, "aria-controls": action.expandedControlsId, "aria-expanded": action.hasPopup ? action.expanded : undefined, "aria-haspopup": action.hasPopup ? 'dialog' : undefined, className: "liquid-header-shell__action", href: action.href, onClick: (event) => {
31
39
  if (action.disabled) {
32
40
  event.preventDefault();
33
41
  return;
@@ -35,17 +43,20 @@ function HeaderUtilityAction({ action, showLabel = false, onAction, }) {
35
43
  onAction(action);
36
44
  }, "aria-disabled": action.disabled ? true : undefined, children: [icon, showLabel ? (_jsx("span", { className: "liquid-header-shell__action-label", children: action.label })) : null] }));
37
45
  }
38
- return (_jsxs("button", { "aria-label": action.label, className: "liquid-header-shell__action", disabled: action.disabled, onClick: () => {
46
+ return (_jsxs("button", { "aria-label": action.label, "aria-controls": action.expandedControlsId, "aria-expanded": action.hasPopup ? action.expanded : undefined, "aria-haspopup": action.hasPopup ? 'dialog' : undefined, className: "liquid-header-shell__action", disabled: action.disabled, onClick: () => {
39
47
  if (!action.disabled) {
40
48
  onAction(action);
41
49
  }
42
50
  }, type: "button", children: [icon, showLabel ? (_jsx("span", { className: "liquid-header-shell__action-label", children: action.label })) : null] }));
43
51
  }
44
- export function HeaderShell({ activeNavigationItemId, actions, brand, className, defaultActiveNavigationItemId, menuTriggerLabel = "Open menu", navigationItems, navLabel = "Primary", onAction, onMenuTriggerClick, onNavigationChange, showMenuTrigger, style, ...props }) {
52
+ export function HeaderShell({ activeNavigationItemId, actions, brand, className, defaultActiveNavigationItemId, menuTriggerLabel = 'Open menu', navigationItems, navLabel = 'Primary', onAction, onMenuTriggerClick, onNavigationChange, showMenuTrigger, showNav = true, showUtilities = true, style, ...props }) {
45
53
  const fallbackActiveId = useMemo(() => getFirstEnabledNavigationItem(navigationItems), [navigationItems]);
46
54
  const [internalActiveId, setInternalActiveId] = useState(defaultActiveNavigationItemId ?? fallbackActiveId);
47
55
  const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
48
56
  const mobileAccordionId = useId();
57
+ const menuTriggerRef = useRef(null);
58
+ const mobilePanelRef = useRef(null);
59
+ const wasMobileMenuOpen = useRef(false);
49
60
  const shouldShowMenuTrigger = showMenuTrigger ?? true;
50
61
  const resolvedActiveId = activeNavigationItemId ?? internalActiveId ?? fallbackActiveId;
51
62
  const closeMobileMenu = () => {
@@ -68,32 +79,61 @@ export function HeaderShell({ activeNavigationItemId, actions, brand, className,
68
79
  onMenuTriggerClick?.();
69
80
  };
70
81
  useEffect(() => {
82
+ if (isMobileMenuOpen) {
83
+ const firstFocusable = mobilePanelRef.current?.querySelector('a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])');
84
+ firstFocusable?.focus();
85
+ wasMobileMenuOpen.current = true;
86
+ }
87
+ else if (wasMobileMenuOpen.current) {
88
+ menuTriggerRef.current?.focus();
89
+ wasMobileMenuOpen.current = false;
90
+ }
71
91
  if (!isMobileMenuOpen) {
72
92
  return;
73
93
  }
74
94
  const handleEscape = (event) => {
75
- if (event.key === "Escape") {
95
+ if (event.key === 'Escape') {
76
96
  closeMobileMenu();
77
97
  }
78
98
  };
79
99
  const previousOverflow = document.body.style.overflow;
80
- document.body.style.overflow = "hidden";
81
- window.addEventListener("keydown", handleEscape);
100
+ document.body.style.overflow = 'hidden';
101
+ window.addEventListener('keydown', handleEscape);
82
102
  return () => {
83
103
  document.body.style.overflow = previousOverflow;
84
- window.removeEventListener("keydown", handleEscape);
104
+ window.removeEventListener('keydown', handleEscape);
85
105
  };
86
106
  }, [isMobileMenuOpen]);
107
+ const handleMobilePanelKeyDown = (event) => {
108
+ if (event.key !== 'Tab') {
109
+ return;
110
+ }
111
+ const focusable = Array.from(mobilePanelRef.current?.querySelectorAll('a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])') ?? []);
112
+ if (!focusable.length) {
113
+ return;
114
+ }
115
+ const first = focusable[0];
116
+ const last = focusable[focusable.length - 1];
117
+ if (event.shiftKey && document.activeElement === first) {
118
+ event.preventDefault();
119
+ last.focus();
120
+ }
121
+ else if (!event.shiftKey && document.activeElement === last) {
122
+ event.preventDefault();
123
+ first.focus();
124
+ }
125
+ };
87
126
  const navigationContent = (_jsx(_Fragment, { children: navigationItems.map((item) => (_jsx(HeaderNavigationLink, { activeItemId: resolvedActiveId, item: item, onSelect: handleNavigationSelect }, item.id))) }));
88
127
  const actionsContent = actions?.length ? (_jsx(_Fragment, { children: actions.map((action) => (_jsx(HeaderUtilityAction, { action: action, onAction: handleAction }, action.id))) })) : null;
89
128
  const mobileActionsContent = actions?.length ? (_jsx(_Fragment, { children: actions.map((action) => (_jsx(HeaderUtilityAction, { action: action, showLabel: true, onAction: handleAction }, `mobile:${action.id}`))) })) : null;
90
- return (_jsxs("header", { ...props, className: getClassName(className), "data-mobile-menu-enabled": shouldShowMenuTrigger ? "true" : undefined, style: style, children: [_jsxs("div", { className: "liquid-header-shell__inner", children: [_jsxs("div", { className: "liquid-header-shell__left", children: [shouldShowMenuTrigger ? (_jsx("button", { "aria-label": menuTriggerLabel, "aria-controls": mobileAccordionId, "aria-expanded": isMobileMenuOpen, className: "liquid-header-shell__action liquid-header-shell__menu-trigger", onClick: handleMenuTriggerClick, type: "button", children: _jsx(Icon, { name: isMobileMenuOpen ? "close" : "menu", size: 20 }) })) : null, _jsx("div", { className: "liquid-header-shell__brand", children: brand }), _jsx("nav", { "aria-label": navLabel, className: "liquid-header-shell__nav", children: _jsx("div", { className: "liquid-header-shell__nav-list", children: navigationContent }) })] }), actionsContent ? (_jsx("div", { className: "liquid-header-shell__actions", children: actionsContent })) : null, shouldShowMenuTrigger ? (_jsx("div", { "aria-hidden": "true", className: "liquid-header-shell__right-spacer" })) : null] }), shouldShowMenuTrigger ? (_jsxs("div", { className: "liquid-header-shell__mobile-layer", "data-open": isMobileMenuOpen ? "true" : undefined, hidden: !isMobileMenuOpen, children: [_jsx("button", { "aria-label": "Close menu", className: "liquid-header-shell__mobile-backdrop", onClick: () => {
129
+ return (_jsxs("header", { ...props, className: getClassName(className), "data-mobile-menu-enabled": shouldShowMenuTrigger ? 'true' : undefined, style: style, children: [_jsxs("div", { className: "liquid-header-shell__inner", children: [_jsxs("div", { className: "liquid-header-shell__left", children: [shouldShowMenuTrigger ? (_jsx("button", { "aria-label": menuTriggerLabel, "aria-controls": mobileAccordionId, "aria-expanded": isMobileMenuOpen, className: "liquid-header-shell__action liquid-header-shell__menu-trigger", ref: menuTriggerRef, onClick: handleMenuTriggerClick, type: "button", children: _jsx(Icon, { name: isMobileMenuOpen ? 'close' : 'menu', size: 20 }) })) : null, _jsx("div", { className: "liquid-header-shell__brand", children: brand }), showNav ? (_jsx("nav", { "aria-label": navLabel, className: "liquid-header-shell__nav", children: _jsx("div", { className: "liquid-header-shell__nav-list", children: navigationContent }) })) : null] }), showUtilities && actionsContent ? (_jsx("div", { className: "liquid-header-shell__actions", children: actionsContent })) : null, shouldShowMenuTrigger ? (_jsx("div", { "aria-hidden": "true", className: "liquid-header-shell__right-spacer" })) : null] }), shouldShowMenuTrigger ? (_jsxs("div", { className: "liquid-header-shell__mobile-layer", "data-open": isMobileMenuOpen ? 'true' : undefined, hidden: !isMobileMenuOpen, children: [_jsx("button", { "aria-label": "Close menu", className: "liquid-header-shell__mobile-backdrop", onClick: () => {
91
130
  closeMobileMenu();
92
- }, type: "button" }), _jsxs("aside", { className: "liquid-header-shell__mobile-panel", id: mobileAccordionId, role: "dialog", "aria-modal": "true", "aria-label": navLabel, onClick: (event) => {
131
+ }, type: "button" }), _jsxs("aside", { className: "liquid-header-shell__mobile-panel", id: mobileAccordionId, role: "dialog", "aria-modal": "true", "aria-label": navLabel, ref: mobilePanelRef, onClick: (event) => {
93
132
  const target = event.target;
94
- if (target.closest(".liquid-header-shell__nav-link") ||
95
- target.closest(".liquid-header-shell__action")) {
133
+ if ((!target.closest('.liquid-header-shell__submenu-trigger') &&
134
+ target.closest('.liquid-header-shell__nav-link')) ||
135
+ target.closest('.liquid-header-shell__action')) {
96
136
  closeMobileMenu();
97
137
  }
98
- }, children: [_jsx("nav", { "aria-label": navLabel, className: "liquid-header-shell__mobile-nav", children: _jsx("div", { className: "liquid-header-shell__mobile-nav-list", children: navigationContent }) }), mobileActionsContent ? (_jsx("div", { className: "liquid-header-shell__mobile-actions", children: mobileActionsContent })) : null] })] })) : null] }));
138
+ }, onKeyDown: handleMobilePanelKeyDown, children: [showNav ? (_jsx("nav", { "aria-label": navLabel, className: "liquid-header-shell__mobile-nav", children: _jsx("div", { className: "liquid-header-shell__mobile-nav-list", children: navigationContent }) })) : null, showUtilities && mobileActionsContent ? (_jsx("div", { className: "liquid-header-shell__mobile-actions", children: mobileActionsContent })) : null] })] })) : null] }));
99
139
  }
@@ -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;;;;;;;;;;;;;;;;;;;CAkPjB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,KAAK,CAAC"}
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: "arrow_right", size: iconSize }) })) : null] }));
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: "arrow_right", size: iconSize }) })) : null] }));
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
  }
@@ -0,0 +1,3 @@
1
+ import type { LoadingProps } from '../../types';
2
+ export declare function Loading({ className, label, showLabel, style, ...props }: LoadingProps): import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=Loading.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Loading.d.ts","sourceRoot":"","sources":["../../../src/components/Loading/Loading.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAMhD,wBAAgB,OAAO,CAAC,EACtB,SAAS,EACT,KAAoB,EACpB,SAAiB,EACjB,KAAK,EACL,GAAG,KAAK,EACT,EAAE,YAAY,2CAiBd"}
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ function getClassName(className) {
3
+ return ['liquid-loading', className].filter(Boolean).join(' ');
4
+ }
5
+ export function Loading({ className, label = 'Loading...', showLabel = false, style, ...props }) {
6
+ return (_jsxs("div", { ...props, "aria-atomic": "true", "aria-label": showLabel ? undefined : label, "aria-live": "polite", className: getClassName(className), role: "status", style: style, children: [_jsx("span", { "aria-hidden": "true", className: "liquid-loading__spinner" }), showLabel ? (_jsx("span", { className: "liquid-loading__label", children: label })) : null] }));
7
+ }
@@ -0,0 +1,3 @@
1
+ import type { LoadingInlineProps } from '../../types';
2
+ export declare function LoadingInline({ className, label, showLabel, state, style, ...props }: LoadingInlineProps): import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=LoadingInline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LoadingInline.d.ts","sourceRoot":"","sources":["../../../src/components/LoadingInline/LoadingInline.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAsB,MAAM,aAAa,CAAC;AAY1E,wBAAgB,aAAa,CAAC,EAC5B,SAAS,EACT,KAAK,EACL,SAAgB,EAChB,KAAgB,EAChB,KAAK,EACL,GAAG,KAAK,EACT,EAAE,kBAAkB,2CA2BpB"}
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Icon } from '../Icon/Icon';
3
+ const DEFAULT_LABELS = {
4
+ active: 'Loading...',
5
+ finish: 'Finished',
6
+ error: 'Error',
7
+ };
8
+ function getClassName(className) {
9
+ return ['liquid-loading-inline', className].filter(Boolean).join(' ');
10
+ }
11
+ export function LoadingInline({ className, label, showLabel = true, state = 'active', style, ...props }) {
12
+ const resolvedLabel = label ?? DEFAULT_LABELS[state];
13
+ const iconName = state === 'finish' ? 'check_circle' : 'error';
14
+ return (_jsxs("span", { ...props, "aria-atomic": "true", "aria-label": showLabel ? undefined : resolvedLabel, "aria-live": "polite", className: getClassName(className), "data-state": state, role: "status", style: style, children: [state === 'active' ? (_jsx("span", { "aria-hidden": "true", className: "liquid-loading-inline__spinner" })) : (_jsx("span", { className: "liquid-loading-inline__status-icon", children: _jsx(Icon, { "aria-hidden": "true", name: iconName, size: 16 }) })), showLabel ? (_jsx("span", { className: "liquid-loading-inline__label", children: resolvedLabel })) : null] }));
15
+ }
@@ -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,2CAgHZ"}
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
- 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: [label ? _jsx("p", { className: "liquid-modal__label", children: label }) : 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] }), _jsxs("div", { className: "liquid-modal__content", children: [description ? (_jsx("div", { className: "liquid-modal__description-wrap", children: _jsx("p", { className: "liquid-modal__description", children: description }) })) : null, 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] }));
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
  }