@kerfjs/ui 5.0.0-beta.24 → 5.0.0-beta.26
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 +44 -23
- package/ai/application-ui-diagnostic-ids-v1.json +3 -0
- package/ai/application-ui-profile.defaults.json +1 -1
- package/ai/compile-time-contracts-v1.json +3 -11
- package/ai/component-catalog-v2-overrides.json +7 -37
- package/ai/component-catalog-v2.d.ts +1 -0
- package/ai/component-catalog-v2.json +415 -91
- package/ai/component-catalog-v2.schema.json +2 -1
- package/ai/component-catalog.json +602 -158
- package/ai/public-api-signatures-v1.md +132 -65
- package/ai/skill.md +20 -20
- package/ai/webawesome-jsx-signatures-v1.md +2 -1
- package/analyzer/cli.mjs +5 -2
- package/analyzer/index.d.mts +1 -0
- package/analyzer/index.mjs +117 -10
- package/dist/app-tab.d.ts +10 -2
- package/dist/app-tab.js +1 -1
- package/dist/browser/list-action-row.js +1 -0
- package/dist/browser/list-item.js +1 -0
- package/dist/browser/surface-scaffold.js +3 -0
- package/dist/catalog.js +5 -4
- package/dist/catalog.js.map +1 -1
- package/dist/{chunk-FEAMR7S4.js → chunk-4EF2CMYS.js} +24 -5
- package/dist/chunk-4EF2CMYS.js.map +1 -0
- package/dist/{chunk-NWSEP5RT.js → chunk-FRVS5RFM.js} +23 -5
- package/dist/chunk-FRVS5RFM.js.map +1 -0
- package/dist/{chunk-PSKN344N.js → chunk-GWEAPEZI.js} +15 -2
- package/dist/chunk-GWEAPEZI.js.map +1 -0
- package/dist/chunk-HP2B2L26.js +102 -0
- package/dist/chunk-HP2B2L26.js.map +1 -0
- package/dist/{chunk-OJWWHFH3.js → chunk-JFGXQBIP.js} +49 -23
- package/dist/chunk-JFGXQBIP.js.map +1 -0
- package/dist/chunk-OBLTAKSX.js +43 -0
- package/dist/chunk-OBLTAKSX.js.map +1 -0
- package/dist/{chunk-Y45PPBDV.js → chunk-OT6RPYAP.js} +16 -2
- package/dist/chunk-OT6RPYAP.js.map +1 -0
- package/dist/{chunk-UFZKLBCF.js → chunk-VCE4MPVE.js} +25 -3
- package/dist/chunk-VCE4MPVE.js.map +1 -0
- package/dist/{chunk-5VTB2BKP.js → chunk-WNWD54GR.js} +16 -2
- package/dist/chunk-WNWD54GR.js.map +1 -0
- package/dist/{chunk-M7JBER5U.js → chunk-X2U3QJCJ.js} +8 -2
- package/dist/chunk-X2U3QJCJ.js.map +1 -0
- package/dist/{chunk-DPDBVKNA.js → chunk-YMKH5XTF.js} +5 -3
- package/dist/chunk-YMKH5XTF.js.map +1 -0
- package/dist/collapsible-panel.d.ts +9 -1
- package/dist/collapsible-panel.js +36 -15
- package/dist/collapsible-panel.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +12 -12
- package/dist/list-action-row.d.ts +11 -1
- package/dist/list-action-row.js +2 -1
- package/dist/list-header.d.ts +15 -2
- package/dist/list-header.js +1 -1
- package/dist/list-item.d.ts +12 -1
- package/dist/list-item.js +2 -1
- package/dist/resizable-region.d.ts +19 -2
- package/dist/resizable-region.js +1 -1
- package/dist/select.d.ts +12 -1
- package/dist/select.js +1 -1
- package/dist/split-view.js +1 -1
- package/dist/styles/app-tab.css +26 -0
- package/dist/styles/collapsible-panel.css +66 -4
- package/dist/styles/list-action-row.css +64 -0
- package/dist/styles/list-header.css +32 -0
- package/dist/styles/list-item.css +39 -0
- package/dist/styles/resizable-region.css +132 -0
- package/dist/styles/select.css +68 -0
- package/dist/styles/styles.css +1 -1
- package/dist/styles/surface-scaffold.css +51 -0
- package/dist/styles/tab-bar.css +24 -0
- package/dist/styles/toolbar-control-group.css +73 -1
- package/dist/styles/toolbar-text.css +1 -1
- package/dist/styles/webawesome.css +12 -0
- package/dist/styles/workbench.css +89 -0
- package/dist/surface-scaffold.d.ts +25 -0
- package/dist/surface-scaffold.js +3 -0
- package/dist/surface-scaffold.js.map +1 -0
- package/dist/tab-bar.d.ts +11 -2
- package/dist/tab-bar.js +1 -1
- package/dist/toolbar-control-group.d.ts +16 -2
- package/dist/toolbar-control-group.js +1 -1
- package/dist/webawesome.d.ts +1 -0
- package/dist/wire-resizable-regions.js +1 -1
- package/dist/wire-sidebar.d.ts +6 -1
- package/dist/wire-sidebar.js +27 -8
- package/dist/wire-sidebar.js.map +1 -1
- package/dist/wire-token-search-fields.js +1 -1
- package/dist/workbench.d.ts +8 -0
- package/dist/workbench.js +42 -0
- package/dist/workbench.js.map +1 -1
- package/docs/accessibility.md +55 -12
- package/docs/collapsible-panel.md +7 -0
- package/docs/component-contract.md +5 -8
- package/docs/component-selection.md +63 -33
- package/docs/design/templates.md +5 -7
- package/docs/examples/component-catalog-extension-v2.json +3 -6
- package/docs/examples/component-catalog-extension.json +1 -1
- package/docs/layout.md +7 -9
- package/docs/recipes.md +8 -7
- package/docs/surface-scaffold.md +17 -0
- package/docs/type-contracts.md +6 -8
- package/docs/ui-analyzer.md +19 -1
- package/docs/ui-doctor.md +1 -1
- package/docs/ux-demo.md +6 -3
- package/docs/webawesome-theme.md +4 -1
- package/docs/workbench.md +49 -2
- package/doctor/eslint-diagnostics.d.mts +16 -0
- package/doctor/eslint-diagnostics.mjs +17 -0
- package/doctor/index.mjs +16 -1
- package/llms.txt +19 -9
- package/package.json +7 -7
- package/ux-demo/recipes/app-shell.tsx +36 -23
- package/ux-demo/recipes/collapsible-sidebar.tsx +22 -16
- package/ux-demo/recipes/composer-form.tsx +15 -6
- package/ux-demo/recipes/list-detail-dialog.tsx +31 -15
- package/ux-demo/recipes/list-workspace-states.tsx +16 -7
- package/ux-demo/recipes/loading-inspector.tsx +39 -18
- package/ux-demo/recipes/recipes.css +7 -2
- package/ux-demo/recipes/workspace-header.tsx +17 -7
- package/dist/browser/panel-header.js +0 -7
- package/dist/chunk-5VTB2BKP.js.map +0 -1
- package/dist/chunk-7XRDUG4Y.js +0 -58
- package/dist/chunk-7XRDUG4Y.js.map +0 -1
- package/dist/chunk-DPDBVKNA.js.map +0 -1
- package/dist/chunk-FEAMR7S4.js.map +0 -1
- package/dist/chunk-M7JBER5U.js.map +0 -1
- package/dist/chunk-NENBUYX5.js +0 -79
- package/dist/chunk-NENBUYX5.js.map +0 -1
- package/dist/chunk-NWSEP5RT.js.map +0 -1
- package/dist/chunk-OJWWHFH3.js.map +0 -1
- package/dist/chunk-PSKN344N.js.map +0 -1
- package/dist/chunk-UFZKLBCF.js.map +0 -1
- package/dist/chunk-Y45PPBDV.js.map +0 -1
- package/dist/panel-header.d.ts +0 -42
- package/dist/panel-header.js +0 -7
- package/dist/panel-header.js.map +0 -1
- package/dist/styles/panel-header.css +0 -64
- package/docs/design/templates/panel-header/icon-actions-dark.svg +0 -1
- package/docs/design/templates/panel-header/icon-actions.svg +0 -1
- package/docs/design/templates/panel-header/icon-summary-actions-dark.svg +0 -1
- package/docs/design/templates/panel-header/icon-summary-actions.svg +0 -1
- package/docs/design/templates/panel-header/no-icon-dark.svg +0 -1
- package/docs/design/templates/panel-header/no-icon.svg +0 -1
- package/docs/design/templates/panel-header/page-heading-dark.svg +0 -1
- package/docs/design/templates/panel-header/page-heading.svg +0 -1
- package/docs/design/templates/panel-header/title-only-dark.svg +0 -1
- package/docs/design/templates/panel-header/title-only.svg +0 -1
- package/docs/design/templates/panel-header-dark.svg +0 -1
- package/docs/design/templates/panel-header.svg +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { filterDataAttributes, filterControlAttributes } from './chunk-SRSJO5QE.js';
|
|
2
2
|
import { Skeleton } from './chunk-RKVQEH4J.js';
|
|
3
|
+
import { LoadingSpinner } from './chunk-6WTETUZ6.js';
|
|
3
4
|
import { jsxs, jsx } from 'kerfjs/jsx-runtime';
|
|
4
5
|
|
|
5
6
|
var PROTECTED_ROOT_DATA_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
@@ -8,6 +9,10 @@ var PROTECTED_ROOT_DATA_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
|
8
9
|
"data-item-id",
|
|
9
10
|
"data-has-icon",
|
|
10
11
|
"data-multiline",
|
|
12
|
+
"data-density",
|
|
13
|
+
"data-divider",
|
|
14
|
+
"data-busy",
|
|
15
|
+
"data-trailing-visibility",
|
|
11
16
|
"data-state",
|
|
12
17
|
"data-selected",
|
|
13
18
|
"data-pressed"
|
|
@@ -19,6 +24,11 @@ var PROTECTED_TRAILING_DATA_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
|
19
24
|
]);
|
|
20
25
|
function ListActionRow({
|
|
21
26
|
label,
|
|
27
|
+
description,
|
|
28
|
+
status,
|
|
29
|
+
busy = false,
|
|
30
|
+
density = "standard",
|
|
31
|
+
divider = "none",
|
|
22
32
|
icon,
|
|
23
33
|
action,
|
|
24
34
|
itemId,
|
|
@@ -36,6 +46,7 @@ function ListActionRow({
|
|
|
36
46
|
trailingActionIcon,
|
|
37
47
|
trailingActionDisabled = false,
|
|
38
48
|
trailingActionTitle,
|
|
49
|
+
trailingActionVisibility = "always",
|
|
39
50
|
className = "",
|
|
40
51
|
style,
|
|
41
52
|
rootAttributes = {},
|
|
@@ -59,11 +70,15 @@ function ListActionRow({
|
|
|
59
70
|
"data-item-id": itemId,
|
|
60
71
|
"data-has-icon": String(Boolean(icon)),
|
|
61
72
|
"data-multiline": multiline ? "true" : void 0,
|
|
73
|
+
"data-density": density,
|
|
74
|
+
"data-divider": divider,
|
|
75
|
+
"data-busy": busy ? "true" : void 0,
|
|
76
|
+
"data-trailing-visibility": trailingActionVisibility,
|
|
62
77
|
"data-state": state,
|
|
63
78
|
"data-selected": String(selected),
|
|
64
79
|
"data-pressed": pressed === void 0 ? void 0 : String(pressed),
|
|
65
80
|
"data-placeholder": placeholder ? "true" : void 0,
|
|
66
|
-
"aria-busy": placeholder ? "true" : void 0,
|
|
81
|
+
"aria-busy": placeholder || busy ? "true" : void 0,
|
|
67
82
|
children: [
|
|
68
83
|
/* @__PURE__ */ jsxs(
|
|
69
84
|
"button",
|
|
@@ -80,7 +95,14 @@ function ListActionRow({
|
|
|
80
95
|
"aria-pressed": pressed === void 0 ? void 0 : String(pressed),
|
|
81
96
|
children: [
|
|
82
97
|
icon && /* @__PURE__ */ jsx("span", { class: "kui-list-action-row__icon", children: placeholder ? /* @__PURE__ */ jsx(Skeleton, { width: "1em", height: "1em" }) : icon }),
|
|
83
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ jsxs("span", { class: "kui-list-action-row__label", children: [
|
|
99
|
+
/* @__PURE__ */ jsx("span", { class: "kui-list-action-row__primary-label", children: placeholder ? /* @__PURE__ */ jsx(Skeleton, { width: "9em" }) : label }),
|
|
100
|
+
!placeholder && description && /* @__PURE__ */ jsx("span", { class: "kui-list-action-row__description", children: description }),
|
|
101
|
+
!placeholder && (busy || status) && /* @__PURE__ */ jsxs("span", { class: "kui-list-action-row__status", children: [
|
|
102
|
+
busy && /* @__PURE__ */ jsx(LoadingSpinner, {}),
|
|
103
|
+
status
|
|
104
|
+
] })
|
|
105
|
+
] })
|
|
84
106
|
]
|
|
85
107
|
}
|
|
86
108
|
),
|
|
@@ -105,4 +127,4 @@ function ListActionRow({
|
|
|
105
127
|
|
|
106
128
|
export { ListActionRow };
|
|
107
129
|
|
|
108
|
-
//# sourceMappingURL=chunk-
|
|
130
|
+
//# sourceMappingURL=chunk-VCE4MPVE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/list-action-row.tsx"],"names":[],"mappings":";;;;;AASA,IAAM,8BAAA,uBAAqC,GAAA,CAAI;AAAA,EAC7C,gBAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,cAAA;AAAA,EACA,cAAA;AAAA,EACA,WAAA;AAAA,EACA,0BAAA;AAAA,EACA,YAAA;AAAA,EACA,eAAA;AAAA,EACA;AACF,CAAC,CAAA;AACD,IAAM,kCAAA,uBAAyC,GAAA,CAAI;AAAA,EACjD,gBAAA;AAAA,EACA,aAAA;AAAA,EACA;AACF,CAAC,CAAA;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,EACT,QAAA,EAAA,WAAA,uBAAe,QAAA,EAAA,EAAS,KAAA,EAAM,KAAA,EAAM,CAAA,GAAK,KAAA,EAC5C,CAAA;AAAA,gBACC,CAAC,WAAA,IAAe,WAAA,wBACd,MAAA,EAAA,EAAK,KAAA,EAAM,oCAAoC,QAAA,EAAA,WAAA,EAAY,CAAA;AAAA,gBAE7D,CAAC,WAAA,KAAgB,IAAA,IAAQ,2BACxB,IAAA,CAAC,MAAA,EAAA,EAAK,OAAM,6BAAA,EACT,QAAA,EAAA;AAAA,kBAAA,IAAA,wBAAS,cAAA,EAAA,EAAe,CAAA;AAAA,kBACxB;AAAA,iBAAA,EACH;AAAA,eAAA,EAEJ;AAAA;AAAA;AAAA,SACF;AAAA,wBACA,GAAA;AAAA,UAAC,QAAA;AAAA,UAAA;AAAA,YACE,GAAG,2BAAA;AAAA,YACJ,IAAA,EAAK,QAAA;AAAA,YACL,KAAA,EAAM,sCAAA;AAAA,YACN,aAAA,EAAa,cAAc,MAAA,GAAY,cAAA;AAAA,YACvC,cAAA,EAAc,MAAA;AAAA,YACd,YAAA,EAAY,mBAAA;AAAA,YACZ,OAAO,mBAAA,IAAuB,mBAAA;AAAA,YAC9B,QAAA,EAAU,0BAA0B,WAAA,IAAe,MAAA;AAAA,YAElD,QAAA,EAAA;AAAA;AAAA;AACH;AAAA;AAAA,GACF;AAEJ","file":"chunk-VCE4MPVE.js","sourcesContent":["import type { SafeHtml } from 'kerfjs';\n\nimport {\n filterControlAttributes,\n filterDataAttributes,\n} from './extension-attributes.js';\nimport { LoadingSpinner } from './loading-spinner.js';\nimport { Skeleton } from './skeleton.js';\n\nconst PROTECTED_ROOT_DATA_ATTRIBUTES = new Set([\n 'data-component',\n 'data-action',\n 'data-item-id',\n 'data-has-icon',\n 'data-multiline',\n 'data-density',\n 'data-divider',\n 'data-busy',\n 'data-trailing-visibility',\n 'data-state',\n 'data-selected',\n 'data-pressed',\n]);\nconst PROTECTED_TRAILING_DATA_ATTRIBUTES = new Set([\n 'data-component',\n 'data-action',\n 'data-item-id',\n]);\n\ntype ListActionRowRootAttributes = Readonly<\n Record<`data-${string}`, string | undefined> & {\n 'data-component'?: never;\n 'data-action'?: never;\n 'data-item-id'?: never;\n 'data-has-icon'?: never;\n 'data-multiline'?: never;\n 'data-density'?: never;\n 'data-divider'?: never;\n 'data-busy'?: never;\n 'data-trailing-visibility'?: never;\n 'data-state'?: never;\n 'data-selected'?: never;\n 'data-pressed'?: never;\n }\n>;\n\ntype ListActionRowTrailingAttributes = Readonly<\n Record<`data-${string}`, string | undefined> & {\n 'data-component'?: never;\n 'data-action'?: never;\n 'data-item-id'?: never;\n popoverTarget?: string;\n popoverTargetAction?: 'toggle' | 'show' | 'hide';\n 'aria-controls'?: string;\n 'aria-haspopup'?: 'dialog' | 'menu' | 'listbox' | 'tree' | 'grid' | 'true';\n }\n>;\n\nexport interface ListActionRowProps {\n /** Visible dormant content for the primary button. Must not contain interactive descendants. */\n label: string | SafeHtml;\n description?: string | SafeHtml;\n status?: string | SafeHtml;\n busy?: boolean;\n density?: 'standard' | 'compact';\n divider?: 'none' | 'before' | 'after' | 'both';\n /** Decorative dormant content for the primary button. Must not contain interactive descendants. */\n icon?: SafeHtml;\n action: string;\n itemId?: string;\n selected?: boolean;\n pressed?: boolean;\n accessibleLabel?: string;\n title?: string;\n multiline?: boolean;\n state?: string;\n disabled?: boolean;\n tabIndex?: number;\n /** Render as an unanimated loading skeleton, disabling both actions. */\n placeholder?: boolean;\n trailingAction: string;\n trailingActionLabel: string;\n /** Decorative dormant content for the trailing button. Must not contain interactive descendants. */\n trailingActionIcon: SafeHtml;\n trailingActionDisabled?: boolean;\n trailingActionTitle?: string;\n trailingActionVisibility?: 'always' | 'interaction';\n className?: string;\n style?: string;\n rootAttributes?: ListActionRowRootAttributes;\n trailingActionAttributes?: ListActionRowTrailingAttributes;\n}\n\nexport function ListActionRow({\n label,\n description,\n status,\n busy = false,\n density = 'standard',\n divider = 'none',\n icon,\n action,\n itemId,\n selected = false,\n pressed,\n accessibleLabel,\n title,\n multiline = false,\n state,\n disabled = false,\n tabIndex,\n placeholder = false,\n trailingAction,\n trailingActionLabel,\n trailingActionIcon,\n trailingActionDisabled = false,\n trailingActionTitle,\n trailingActionVisibility = 'always',\n className = '',\n style,\n rootAttributes = {},\n trailingActionAttributes = {},\n}: ListActionRowProps) {\n const extensionRootAttributes = filterDataAttributes(\n rootAttributes,\n PROTECTED_ROOT_DATA_ATTRIBUTES,\n );\n const extensionTrailingAttributes = filterControlAttributes(\n trailingActionAttributes,\n PROTECTED_TRAILING_DATA_ATTRIBUTES,\n );\n\n return (\n <div\n {...extensionRootAttributes}\n class={`kui-list-action-row ${className}`.trim()}\n style={style}\n data-component=\"list-action-row\"\n data-item-id={itemId}\n data-has-icon={String(Boolean(icon))}\n data-multiline={multiline ? 'true' : undefined}\n data-density={density}\n data-divider={divider}\n data-busy={busy ? 'true' : undefined}\n data-trailing-visibility={trailingActionVisibility}\n data-state={state}\n data-selected={String(selected)}\n data-pressed={pressed === undefined ? undefined : String(pressed)}\n data-placeholder={placeholder ? 'true' : undefined}\n aria-busy={placeholder || busy ? 'true' : undefined}\n >\n <button\n type=\"button\"\n class=\"kui-list-action-row__primary\"\n title={placeholder ? undefined : title}\n disabled={disabled || placeholder}\n tabindex={placeholder ? -1 : tabIndex}\n data-action={placeholder ? undefined : action}\n data-item-id={itemId}\n aria-label={accessibleLabel}\n aria-current={selected ? 'page' : undefined}\n aria-pressed={pressed === undefined ? undefined : String(pressed)}\n >\n {icon && (\n <span class=\"kui-list-action-row__icon\">\n {placeholder ? <Skeleton width=\"1em\" height=\"1em\" /> : icon}\n </span>\n )}\n <span class=\"kui-list-action-row__label\">\n <span class=\"kui-list-action-row__primary-label\">\n {placeholder ? <Skeleton width=\"9em\" /> : label}\n </span>\n {!placeholder && description && (\n <span class=\"kui-list-action-row__description\">{description}</span>\n )}\n {!placeholder && (busy || status) && (\n <span class=\"kui-list-action-row__status\">\n {busy && <LoadingSpinner />}\n {status}\n </span>\n )}\n </span>\n </button>\n <button\n {...extensionTrailingAttributes}\n type=\"button\"\n class=\"kui-list-action-row__trailing-action\"\n data-action={placeholder ? undefined : trailingAction}\n data-item-id={itemId}\n aria-label={trailingActionLabel}\n title={trailingActionTitle ?? trailingActionLabel}\n disabled={trailingActionDisabled || placeholder || undefined}\n >\n {trailingActionIcon}\n </button>\n </div>\n );\n}\n"]}
|
|
@@ -10,7 +10,14 @@ function ToolbarControlGroup({
|
|
|
10
10
|
appearance = "contained",
|
|
11
11
|
tone = "default",
|
|
12
12
|
buttonAppearance = "plain",
|
|
13
|
-
shape = "pill"
|
|
13
|
+
shape = "pill",
|
|
14
|
+
size = "default",
|
|
15
|
+
density = "comfortable",
|
|
16
|
+
content = "icon",
|
|
17
|
+
selectedChrome = "raised",
|
|
18
|
+
selectedTone = "brand",
|
|
19
|
+
nestedDropdown = false,
|
|
20
|
+
scrim = false
|
|
14
21
|
}) {
|
|
15
22
|
return /* @__PURE__ */ jsx(
|
|
16
23
|
"div",
|
|
@@ -25,6 +32,13 @@ function ToolbarControlGroup({
|
|
|
25
32
|
"data-expanded": String(expanded),
|
|
26
33
|
"data-single": String(single),
|
|
27
34
|
"data-shape": shape,
|
|
35
|
+
"data-size": size,
|
|
36
|
+
"data-density": density,
|
|
37
|
+
"data-content": content,
|
|
38
|
+
"data-selected-chrome": selectedChrome,
|
|
39
|
+
"data-selected-tone": selectedTone,
|
|
40
|
+
"data-nested-dropdown": String(nestedDropdown),
|
|
41
|
+
"data-scrim": String(scrim),
|
|
28
42
|
children
|
|
29
43
|
}
|
|
30
44
|
);
|
|
@@ -32,4 +46,4 @@ function ToolbarControlGroup({
|
|
|
32
46
|
|
|
33
47
|
export { ToolbarControlGroup };
|
|
34
48
|
|
|
35
|
-
//# sourceMappingURL=chunk-
|
|
49
|
+
//# sourceMappingURL=chunk-WNWD54GR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/toolbar-control-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AAAA,GACH;AAEJ","file":"chunk-WNWD54GR.js","sourcesContent":["import type { SafeHtml } from 'kerfjs';\n\nexport type ToolbarControlGroupAppearance = 'contained' | 'borderless';\nexport type ToolbarControlGroupTone = 'default' | 'dark';\nexport type ToolbarControlGroupButtonAppearance = 'plain' | 'push';\nexport type ToolbarControlGroupShape = 'pill' | 'rounded';\nexport type ToolbarControlGroupSize = 'default' | 'compact';\nexport type ToolbarControlGroupDensity = 'comfortable' | 'tight';\nexport type ToolbarControlGroupContent = 'icon' | 'text' | 'mixed' | 'avatar';\nexport type ToolbarControlGroupSelectedChrome = 'raised' | 'filled' | 'outline';\nexport type ToolbarControlGroupSelectedTone = 'brand' | 'neutral';\n\nexport interface ToolbarControlGroupProps {\n children: SafeHtml | SafeHtml[];\n label?: string;\n className?: string;\n expanded?: boolean;\n single?: boolean;\n appearance?: ToolbarControlGroupAppearance;\n tone?: ToolbarControlGroupTone;\n buttonAppearance?: ToolbarControlGroupButtonAppearance;\n /** Corner shape: fully round `pill` (default) or a softer `rounded` rectangle. */\n shape?: ToolbarControlGroupShape;\n size?: ToolbarControlGroupSize;\n density?: ToolbarControlGroupDensity;\n content?: ToolbarControlGroupContent;\n selectedChrome?: ToolbarControlGroupSelectedChrome;\n selectedTone?: ToolbarControlGroupSelectedTone;\n /** Size a nested Web Awesome dropdown trigger as part of this group. */\n nestedDropdown?: boolean;\n /** Add contrast behind photo-backed avatar content. */\n scrim?: boolean;\n}\n\nexport function ToolbarControlGroup({\n children,\n label,\n className = '',\n expanded = false,\n single = false,\n appearance = 'contained',\n tone = 'default',\n buttonAppearance = 'plain',\n shape = 'pill',\n size = 'default',\n density = 'comfortable',\n content = 'icon',\n selectedChrome = 'raised',\n selectedTone = 'brand',\n nestedDropdown = false,\n scrim = false,\n}: ToolbarControlGroupProps) {\n return (\n <div\n class={`kui-toolbar-control-group ${className}`.trim()}\n data-component=\"toolbar-control-group\"\n role={label ? 'group' : undefined}\n aria-label={label}\n data-appearance={appearance}\n data-tone={tone}\n data-button-appearance={buttonAppearance}\n data-expanded={String(expanded)}\n data-single={String(single)}\n data-shape={shape}\n data-size={size}\n data-density={density}\n data-content={content}\n data-selected-chrome={selectedChrome}\n data-selected-tone={selectedTone}\n data-nested-dropdown={String(nestedDropdown)}\n data-scrim={String(scrim)}\n >\n {children}\n </div>\n );\n}\n"]}
|
|
@@ -8,7 +8,10 @@ function TabBar({
|
|
|
8
8
|
leading,
|
|
9
9
|
trailing,
|
|
10
10
|
className = "",
|
|
11
|
-
activation
|
|
11
|
+
activation,
|
|
12
|
+
allocation = "intrinsic",
|
|
13
|
+
presentation = "rail",
|
|
14
|
+
trailingPlacement = "separate"
|
|
12
15
|
}) {
|
|
13
16
|
return /* @__PURE__ */ jsxs(
|
|
14
17
|
"nav",
|
|
@@ -17,6 +20,9 @@ function TabBar({
|
|
|
17
20
|
"data-component": "tab-bar",
|
|
18
21
|
"data-tab-bar-id": id,
|
|
19
22
|
"data-tab-activation": activation,
|
|
23
|
+
"data-allocation": allocation,
|
|
24
|
+
"data-presentation": presentation,
|
|
25
|
+
"data-trailing-placement": trailingPlacement,
|
|
20
26
|
"aria-label": label,
|
|
21
27
|
children: [
|
|
22
28
|
leading && /* @__PURE__ */ jsx("div", { class: "kui-tab-bar__leading", children: leading }),
|
|
@@ -38,4 +44,4 @@ function TabBar({
|
|
|
38
44
|
|
|
39
45
|
export { TabBar };
|
|
40
46
|
|
|
41
|
-
//# sourceMappingURL=chunk-
|
|
47
|
+
//# sourceMappingURL=chunk-X2U3QJCJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tab-bar.tsx"],"names":[],"mappings":";;;AA8BO,SAAS,MAAA,CAAO;AAAA,EACrB,EAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA,GAAY,EAAA;AAAA,EACZ,UAAA;AAAA,EACA,UAAA,GAAa,WAAA;AAAA,EACb,YAAA,GAAe,MAAA;AAAA,EACf,iBAAA,GAAoB;AACtB,CAAA,EAAgB;AACd,EAAA,uBACE,IAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO,CAAA,YAAA,EAAe,SAAS,CAAA,CAAA,CAAG,IAAA,EAAK;AAAA,MACvC,gBAAA,EAAe,SAAA;AAAA,MACf,iBAAA,EAAiB,EAAA;AAAA,MACjB,qBAAA,EAAqB,UAAA;AAAA,MACrB,iBAAA,EAAiB,UAAA;AAAA,MACjB,mBAAA,EAAmB,YAAA;AAAA,MACnB,yBAAA,EAAyB,iBAAA;AAAA,MACzB,YAAA,EAAY,KAAA;AAAA,MAEX,QAAA,EAAA;AAAA,QAAA,OAAA,oBAAW,GAAA,CAAC,KAAA,EAAA,EAAI,KAAA,EAAM,sBAAA,EAAwB,QAAA,EAAA,OAAA,EAAQ,CAAA;AAAA,wBACvD,GAAA;AAAA,UAAC,KAAA;AAAA,UAAA;AAAA,YACC,KAAA,EAAM,mBAAA;AAAA,YACN,IAAA,EAAK,SAAA;AAAA,YACL,YAAA,EAAY,KAAA;AAAA,YACZ,mBAAA,EAAiB,IAAA;AAAA,YAEhB;AAAA;AAAA,SACH;AAAA,QACC,QAAA,oBAAY,GAAA,CAAC,KAAA,EAAA,EAAI,KAAA,EAAM,yBAAyB,QAAA,EAAA,QAAA,EAAS;AAAA;AAAA;AAAA,GAC5D;AAEJ","file":"chunk-X2U3QJCJ.js","sourcesContent":["import type { SafeHtml } from 'kerfjs';\n\nexport type TabActivation = 'automatic' | 'manual';\nexport type TabBarAllocation = 'intrinsic' | 'fill';\nexport type TabBarPresentation = 'rail' | 'segmented' | 'inspector';\nexport type TabBarTrailingPlacement = 'separate' | 'adjacent';\n\nexport interface TabBarProps {\n id: string;\n label: string;\n children: SafeHtml | readonly SafeHtml[];\n leading?: SafeHtml;\n trailing?: SafeHtml;\n className?: string;\n /**\n * Keyboard activation mode for this strip, emitted as `data-tab-activation` for\n * `wireTabBars` to read (overrides its `activation` option). `'automatic'` (default)\n * selects on arrow / Home / End; `'manual'` moves roving focus only and the user\n * selects with Enter / Space / click — use it when selecting a tab is a heavy action.\n */\n activation?: TabActivation;\n /** How available strip width is allocated across child AppTabs. */\n allocation?: TabBarAllocation;\n /** Named strip chrome for application rails, segmented tabs, or inspectors. */\n presentation?: TabBarPresentation;\n /** Keep a trailing action beside the final tab or at the far edge of the bar. */\n trailingPlacement?: TabBarTrailingPlacement;\n}\n\n/** Render a controlled tab strip. The application owns selection, order, and persistence. */\nexport function TabBar({\n id,\n label,\n children,\n leading,\n trailing,\n className = '',\n activation,\n allocation = 'intrinsic',\n presentation = 'rail',\n trailingPlacement = 'separate',\n}: TabBarProps) {\n return (\n <nav\n class={`kui-tab-bar ${className}`.trim()}\n data-component=\"tab-bar\"\n data-tab-bar-id={id}\n data-tab-activation={activation}\n data-allocation={allocation}\n data-presentation={presentation}\n data-trailing-placement={trailingPlacement}\n aria-label={label}\n >\n {leading && <div class=\"kui-tab-bar__leading\">{leading}</div>}\n <div\n class=\"kui-tab-bar__tabs\"\n role=\"tablist\"\n aria-label={label}\n data-kui-tab-list\n >\n {children}\n </div>\n {trailing && <div class=\"kui-tab-bar__trailing\">{trailing}</div>}\n </nav>\n );\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { resizeRegionFromPointer, clampRegionSize } from './chunk-
|
|
1
|
+
import { resizeRegionFromPointer, clampRegionSize } from './chunk-HP2B2L26.js';
|
|
2
2
|
import { delegate } from 'kerfjs';
|
|
3
3
|
|
|
4
4
|
function regionState(handle) {
|
|
@@ -13,7 +13,7 @@ function regionState(handle) {
|
|
|
13
13
|
const min = Number(handle.getAttribute("aria-valuemin"));
|
|
14
14
|
const max = Number(handle.getAttribute("aria-valuemax"));
|
|
15
15
|
const size = Number(handle.getAttribute("aria-valuenow"));
|
|
16
|
-
if (!id || axis !== "horizontal" && axis !== "vertical" || edge !== "start" && edge !== "end" || !Number.isFinite(min) || !Number.isFinite(max) || !Number.isFinite(size))
|
|
16
|
+
if (!id || region.dataset.collapsed === "true" || region.dataset.presentation !== "inline" || axis !== "horizontal" && axis !== "vertical" || edge !== "start" && edge !== "end" || !Number.isFinite(min) || !Number.isFinite(max) || !Number.isFinite(size))
|
|
17
17
|
return void 0;
|
|
18
18
|
return { region, handle, id, axis, edge, min, max, size };
|
|
19
19
|
}
|
|
@@ -92,10 +92,12 @@ function wireResizableRegions(root, {
|
|
|
92
92
|
root.removeEventListener("pointerup", finish);
|
|
93
93
|
root.removeEventListener("pointercancel", finish);
|
|
94
94
|
stopPointer = void 0;
|
|
95
|
+
delete state.region.dataset.resizing;
|
|
95
96
|
onCommit({ id: state.id, size: next, source: "pointer" });
|
|
96
97
|
};
|
|
97
98
|
stopPointer?.();
|
|
98
99
|
stopPointer = finish;
|
|
100
|
+
state.region.dataset.resizing = "true";
|
|
99
101
|
root.addEventListener("pointermove", move);
|
|
100
102
|
root.addEventListener("pointerup", finish, { once: true });
|
|
101
103
|
root.addEventListener("pointercancel", finish, { once: true });
|
|
@@ -110,4 +112,4 @@ function wireResizableRegions(root, {
|
|
|
110
112
|
|
|
111
113
|
export { wireResizableRegions };
|
|
112
114
|
|
|
113
|
-
//# sourceMappingURL=chunk-
|
|
115
|
+
//# sourceMappingURL=chunk-YMKH5XTF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/wire-resizable-regions.ts"],"names":[],"mappings":";;;AAiCA,SAAS,YAAY,MAAA,EAA0C;AAC7D,EAAA,MAAM,SAAS,MAAA,CAAO,OAAA;AAAA,IACpB;AAAA,GACF;AACA,EAAA,IAAI,EAAE,MAAA,YAAkB,WAAA,CAAA,IAAgB,EAAE,MAAA,YAAkB,WAAA,CAAA;AAC1D,IAAA,OAAO,MAAA;AACT,EAAA,MAAM,EAAA,GAAK,OAAO,OAAA,CAAQ,QAAA;AAC1B,EAAA,MAAM,IAAA,GAAO,OAAO,OAAA,CAAQ,IAAA;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AA,EAClB,CAAA;AACF","file":"chunk-YMKH5XTF.js","sourcesContent":["import { delegate } from 'kerfjs';\n\nimport {\n clampRegionSize,\n type ResizableRegionAxis,\n type ResizableRegionEdge,\n resizeRegionFromPointer,\n} from './resizable-region.js';\n\nexport interface ResizeCommit {\n id: string;\n size: number;\n source: 'keyboard' | 'pointer';\n}\n\nexport interface WireResizableRegionsOptions {\n step?: number;\n largeStep?: number;\n onPreview?: (change: ResizeCommit) => void;\n onCommit: (change: ResizeCommit) => void;\n}\n\ninterface RegionState {\n region: HTMLElement;\n handle: HTMLElement;\n id: string;\n axis: ResizableRegionAxis;\n edge: ResizableRegionEdge;\n min: number;\n max: number;\n size: number;\n}\n\nfunction regionState(handle: Element): RegionState | undefined {\n const region = handle.closest<HTMLElement>(\n '[data-component=\"resizable-region\"]',\n );\n if (!(region instanceof HTMLElement) || !(handle instanceof HTMLElement))\n return undefined;\n const id = region.dataset.regionId;\n const axis = region.dataset.axis;\n const edge = region.dataset.edge;\n const min = Number(handle.getAttribute('aria-valuemin'));\n const max = Number(handle.getAttribute('aria-valuemax'));\n const size = Number(handle.getAttribute('aria-valuenow'));\n if (\n !id ||\n region.dataset.collapsed === 'true' ||\n region.dataset.presentation !== 'inline' ||\n (axis !== 'horizontal' && axis !== 'vertical') ||\n (edge !== 'start' && edge !== 'end') ||\n !Number.isFinite(min) ||\n !Number.isFinite(max) ||\n !Number.isFinite(size)\n )\n return undefined;\n return { region, handle, id, axis, edge, min, max, size };\n}\n\nfunction preview(\n state: RegionState,\n size: number,\n onPreview?: (change: ResizeCommit) => void,\n) {\n const next = clampRegionSize(size, state.min, state.max);\n state.region.style.setProperty('--kui-resizable-region-size', `${next}px`);\n state.handle.setAttribute('aria-valuenow', String(next));\n onPreview?.({ id: state.id, size: next, source: 'pointer' });\n return next;\n}\n\n/** Wire pointer and separator-keyboard behavior for every ResizableRegion below root. */\nexport function wireResizableRegions(\n root: HTMLElement,\n {\n step = 16,\n largeStep = 64,\n onPreview,\n onCommit,\n }: WireResizableRegionsOptions,\n) {\n let stopPointer: (() => void) | undefined;\n\n const stopKeydown = delegate(\n root,\n 'keydown',\n '[data-kui-resize-handle]',\n (event, handle) => {\n const keyboardEvent = event as KeyboardEvent;\n const state = regionState(handle);\n if (!state) return;\n let next: number | undefined;\n if (keyboardEvent.key === 'Home') next = state.min;\n if (keyboardEvent.key === 'End') next = state.max;\n const increment = keyboardEvent.shiftKey ? largeStep : step;\n if (state.axis === 'horizontal' && keyboardEvent.key === 'ArrowLeft')\n next = resizeRegionFromPointer(state.size, -increment, state.edge);\n if (state.axis === 'horizontal' && keyboardEvent.key === 'ArrowRight')\n next = resizeRegionFromPointer(state.size, increment, state.edge);\n if (state.axis === 'vertical' && keyboardEvent.key === 'ArrowUp')\n next = resizeRegionFromPointer(state.size, -increment, state.edge);\n if (state.axis === 'vertical' && keyboardEvent.key === 'ArrowDown')\n next = resizeRegionFromPointer(state.size, increment, state.edge);\n if (next === undefined) return;\n keyboardEvent.preventDefault();\n const size = clampRegionSize(next, state.min, state.max);\n state.region.style.setProperty(\n '--kui-resizable-region-size',\n `${size}px`,\n );\n state.handle.setAttribute('aria-valuenow', String(size));\n onCommit({ id: state.id, size, source: 'keyboard' });\n },\n );\n\n const stopPointerDown = delegate(\n root,\n 'pointerdown',\n '[data-kui-resize-handle]',\n (event, handle) => {\n const pointerEvent = event as PointerEvent;\n if (pointerEvent.button !== 0) return;\n const state = regionState(handle);\n if (!state) return;\n pointerEvent.preventDefault();\n state.handle.setPointerCapture?.(pointerEvent.pointerId);\n const startCoordinate =\n state.axis === 'horizontal'\n ? pointerEvent.clientX\n : pointerEvent.clientY;\n let next = state.size;\n const move = (moveEvent: PointerEvent) => {\n const coordinate =\n state.axis === 'horizontal' ? moveEvent.clientX : moveEvent.clientY;\n next = preview(\n state,\n resizeRegionFromPointer(\n state.size,\n coordinate - startCoordinate,\n state.edge,\n ),\n onPreview,\n );\n };\n const finish = () => {\n root.removeEventListener('pointermove', move);\n root.removeEventListener('pointerup', finish);\n root.removeEventListener('pointercancel', finish);\n stopPointer = undefined;\n delete state.region.dataset.resizing;\n onCommit({ id: state.id, size: next, source: 'pointer' });\n };\n stopPointer?.();\n stopPointer = finish;\n state.region.dataset.resizing = 'true';\n root.addEventListener('pointermove', move);\n root.addEventListener('pointerup', finish, { once: true });\n root.addEventListener('pointercancel', finish, { once: true });\n },\n );\n\n return () => {\n stopPointer?.();\n stopKeydown();\n stopPointerDown();\n };\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SafeHtml } from 'kerfjs';
|
|
2
2
|
import { LucideIcon } from './lucide-icon.js';
|
|
3
|
+
import { ResizableRegionSeparator, ResizableRegionCollapseMotion, ResizableRegionContentOverflow, ResizableRegionPresentation, ResizableRegionRestorePosition } from './resizable-region.js';
|
|
3
4
|
import 'lucide';
|
|
4
5
|
|
|
5
6
|
/** Which edge a {@link CollapsiblePanel} docks to. */
|
|
@@ -49,6 +50,13 @@ interface CollapsiblePanelProps {
|
|
|
49
50
|
label?: string;
|
|
50
51
|
/** Panel content. */
|
|
51
52
|
children?: SafeHtml | readonly SafeHtml[];
|
|
53
|
+
separator?: ResizableRegionSeparator;
|
|
54
|
+
collapseMotion?: ResizableRegionCollapseMotion;
|
|
55
|
+
contentOverflow?: ResizableRegionContentOverflow;
|
|
56
|
+
presentation?: ResizableRegionPresentation;
|
|
57
|
+
/** Control shown in a safe-area-aware viewport corner while collapsed. */
|
|
58
|
+
restoreControl?: SafeHtml;
|
|
59
|
+
restorePosition?: ResizableRegionRestorePosition;
|
|
52
60
|
className?: string;
|
|
53
61
|
}
|
|
54
62
|
/**
|
|
@@ -61,6 +69,6 @@ interface CollapsiblePanelProps {
|
|
|
61
69
|
* and persistence semantics, and with `CollapsiblePanelToggle` for the standard
|
|
62
70
|
* affordance. See `docs/24-collapsible-panel.md`.
|
|
63
71
|
*/
|
|
64
|
-
declare function CollapsiblePanel({ id, side, collapsed, size, label, children, className, }: CollapsiblePanelProps): SafeHtml;
|
|
72
|
+
declare function CollapsiblePanel({ id, side, collapsed, size, label, children, separator, collapseMotion, contentOverflow, presentation, restoreControl, restorePosition, className, }: CollapsiblePanelProps): SafeHtml;
|
|
65
73
|
|
|
66
74
|
export { CollapsiblePanel, type CollapsiblePanelProps, type CollapsiblePanelSide, CollapsiblePanelToggle, type CollapsiblePanelToggleProps, collapsiblePanelToggleIcon };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LucideIcon } from './chunk-W2FK7ZNY.js';
|
|
2
2
|
import { PanelLeftOpen, PanelLeftClose, PanelRightOpen, PanelRightClose, PanelBottomOpen, PanelBottomClose } from 'lucide';
|
|
3
|
-
import { jsx } from 'kerfjs/jsx-runtime';
|
|
3
|
+
import { jsx, jsxs, Fragment } from 'kerfjs/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
function collapsiblePanelToggleIcon(side, collapsed) {
|
|
6
6
|
if (side === "left")
|
|
@@ -39,23 +39,44 @@ function CollapsiblePanel({
|
|
|
39
39
|
size,
|
|
40
40
|
label,
|
|
41
41
|
children,
|
|
42
|
+
separator = "auto",
|
|
43
|
+
collapseMotion = "slide",
|
|
44
|
+
contentOverflow = "clip",
|
|
45
|
+
presentation = "inline",
|
|
46
|
+
restoreControl,
|
|
47
|
+
restorePosition = side === "left" ? "bottom-start" : "bottom-end",
|
|
42
48
|
className = ""
|
|
43
49
|
}) {
|
|
44
50
|
const sizeVar = side === "bottom" ? "--kui-collapsible-panel-height" : "--kui-collapsible-panel-width";
|
|
45
|
-
return /* @__PURE__ */
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
51
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
52
|
+
/* @__PURE__ */ jsx(
|
|
53
|
+
"aside",
|
|
54
|
+
{
|
|
55
|
+
class: `kui-collapsible-panel kui-collapsible-panel--${side} ${className}`.trim(),
|
|
56
|
+
"data-component": "collapsible-panel",
|
|
57
|
+
"data-collapsible-panel": id,
|
|
58
|
+
"data-side": side,
|
|
59
|
+
"data-collapsed": String(collapsed),
|
|
60
|
+
"data-separator": separator,
|
|
61
|
+
"data-collapse-motion": collapseMotion,
|
|
62
|
+
"data-content-overflow": contentOverflow,
|
|
63
|
+
"data-presentation": presentation,
|
|
64
|
+
"aria-label": label || void 0,
|
|
65
|
+
"aria-hidden": collapsed || presentation === "hidden" ? "true" : void 0,
|
|
66
|
+
style: size ? `${sizeVar}: ${size}px` : void 0,
|
|
67
|
+
children: /* @__PURE__ */ jsx("div", { class: "kui-collapsible-panel__content", children })
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
collapsed && restoreControl && presentation !== "hidden" && /* @__PURE__ */ jsx(
|
|
71
|
+
"div",
|
|
72
|
+
{
|
|
73
|
+
class: "kui-collapsible-panel__restore",
|
|
74
|
+
"data-panel-restore": id,
|
|
75
|
+
"data-position": restorePosition,
|
|
76
|
+
children: restoreControl
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
] });
|
|
59
80
|
}
|
|
60
81
|
|
|
61
82
|
export { CollapsiblePanel, CollapsiblePanelToggle, collapsiblePanelToggleIcon };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/collapsible-panel.tsx"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"sources":["../src/collapsible-panel.tsx"],"names":[],"mappings":";;;;AA6BO,SAAS,0BAAA,CACd,MACA,SAAA,EACkE;AAClE,EAAA,IAAI,IAAA,KAAS,MAAA;AACX,IAAA,OAAO,SAAA,GACH,EAAE,IAAA,EAAM,aAAA,EAAe,IAAA,EAAM,iBAAA,EAAkB,GAC/C,EAAE,IAAA,EAAM,cAAA,EAAgB,IAAA,EAAM,kBAAA,EAAmB;AACvD,EAAA,IAAI,IAAA,KAAS,OAAA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,QACpB,eAAA,EAAe,eAAA;AAAA,QAEd,QAAA,EAAA;AAAA;AAAA;AACH,GAAA,EAEJ,CAAA;AAEJ","file":"collapsible-panel.js","sourcesContent":["import type { SafeHtml } from 'kerfjs';\nimport {\n PanelBottomClose,\n PanelBottomOpen,\n PanelLeftClose,\n PanelLeftOpen,\n PanelRightClose,\n PanelRightOpen,\n} from 'lucide';\n\nimport { LucideIcon } from './lucide-icon.js';\nimport type {\n ResizableRegionCollapseMotion,\n ResizableRegionContentOverflow,\n ResizableRegionPresentation,\n ResizableRegionRestorePosition,\n ResizableRegionSeparator,\n} from './resizable-region.js';\n\n/** Which edge a {@link CollapsiblePanel} docks to. */\nexport type CollapsiblePanelSide = 'left' | 'right' | 'bottom';\n\n/**\n * The standard collapse/expand icon for a panel `side` and `collapsed` state,\n * so every app's sidebars and drawers use one recognizable convention:\n * `PanelLeft*` for a left rail, `PanelRight*` for a right rail, `PanelBottom*`\n * for a bottom drawer — the `Close` glyph while open, the `Open` glyph while\n * collapsed. Exposed so an app can render its own toggle affordance.\n */\nexport function collapsiblePanelToggleIcon(\n side: CollapsiblePanelSide,\n collapsed: boolean,\n): { icon: Parameters<typeof LucideIcon>[0]['icon']; name: string } {\n if (side === 'left')\n return collapsed\n ? { icon: PanelLeftOpen, name: 'panel-left-open' }\n : { icon: PanelLeftClose, name: 'panel-left-close' };\n if (side === 'right')\n return collapsed\n ? { icon: PanelRightOpen, name: 'panel-right-open' }\n : { icon: PanelRightClose, name: 'panel-right-close' };\n return collapsed\n ? { icon: PanelBottomOpen, name: 'panel-bottom-open' }\n : { icon: PanelBottomClose, name: 'panel-bottom-close' };\n}\n\nexport interface CollapsiblePanelToggleProps {\n /** The panel this toggle controls. */\n side: CollapsiblePanelSide;\n /** The panel's current collapsed state (drives the icon direction). */\n collapsed: boolean;\n /** `data-action` the button carries so `wireSidebar` can delegate its click. */\n action: string;\n /** The panel id the button targets (`data-tab-panel`-style: `data-collapsible-panel`). */\n panelId?: string;\n /** Accessible label; defaults to \"Collapse\"/\"Expand\". */\n label?: string;\n className?: string;\n}\n\n/**\n * A standard collapse/expand toggle button for a {@link CollapsiblePanel}: the\n * recognizable per-side icon (see {@link collapsiblePanelToggleIcon}) plus the\n * `data-action` / `aria-expanded` `wireSidebar` reads. Placement is the app's —\n * put it in the panel's own header (to collapse) and somewhere always-visible\n * (to expand while collapsed).\n */\nexport function CollapsiblePanelToggle({\n side,\n collapsed,\n action,\n panelId,\n label,\n className = '',\n}: CollapsiblePanelToggleProps) {\n const glyph = collapsiblePanelToggleIcon(side, collapsed);\n const accessible = label ?? (collapsed ? 'Expand' : 'Collapse');\n return (\n <button\n type=\"button\"\n class={`kui-collapsible-panel__toggle ${className}`.trim()}\n data-action={action}\n data-collapsible-target={panelId}\n aria-expanded={String(!collapsed)}\n aria-label={accessible}\n >\n <LucideIcon icon={glyph.icon} name={glyph.name} />\n </button>\n );\n}\n\nexport interface CollapsiblePanelProps {\n /** A stable id for the panel — `wireSidebar` targets it and toggles reference it. */\n id: string;\n /** Which edge the panel docks to: a left/right rail or a bottom drawer. */\n side: CollapsiblePanelSide;\n /** Whether the panel is currently collapsed (the app owns this signal). */\n collapsed?: boolean;\n /** Rail width or drawer height in px. Overrides the CSS default. */\n size?: number;\n /** Accessible label for the panel region. */\n label?: string;\n /** Panel content. */\n children?: SafeHtml | readonly SafeHtml[];\n separator?: ResizableRegionSeparator;\n collapseMotion?: ResizableRegionCollapseMotion;\n contentOverflow?: ResizableRegionContentOverflow;\n presentation?: ResizableRegionPresentation;\n /** Control shown in a safe-area-aware viewport corner while collapsed. */\n restoreControl?: SafeHtml;\n restorePosition?: ResizableRegionRestorePosition;\n className?: string;\n}\n\n/**\n * A standalone collapsible side rail or bottom drawer, outside the full\n * {@link Workbench} shell. It owns only the presentation: a fixed-size content\n * area that stays laid out while the panel's track snaps to zero and the content\n * slides out via `transform` (one reflow, composited — the same technique\n * `Workbench` and the catalog sidebar use). The app owns the `collapsed` signal;\n * pair it with `wireSidebar` for the toggle, focus, compact-overlay, keyboard,\n * and persistence semantics, and with `CollapsiblePanelToggle` for the standard\n * affordance. See `docs/24-collapsible-panel.md`.\n */\nexport function CollapsiblePanel({\n id,\n side,\n collapsed = false,\n size,\n label,\n children,\n separator = 'auto',\n collapseMotion = 'slide',\n contentOverflow = 'clip',\n presentation = 'inline',\n restoreControl,\n restorePosition = side === 'left' ? 'bottom-start' : 'bottom-end',\n className = '',\n}: CollapsiblePanelProps) {\n const sizeVar =\n side === 'bottom'\n ? '--kui-collapsible-panel-height'\n : '--kui-collapsible-panel-width';\n return (\n <>\n <aside\n class={`kui-collapsible-panel kui-collapsible-panel--${side} ${className}`.trim()}\n data-component=\"collapsible-panel\"\n data-collapsible-panel={id}\n data-side={side}\n data-collapsed={String(collapsed)}\n data-separator={separator}\n data-collapse-motion={collapseMotion}\n data-content-overflow={contentOverflow}\n data-presentation={presentation}\n aria-label={label || undefined}\n aria-hidden={\n collapsed || presentation === 'hidden' ? 'true' : undefined\n }\n style={size ? `${sizeVar}: ${size}px` : undefined}\n >\n <div class=\"kui-collapsible-panel__content\">{children}</div>\n </aside>\n {collapsed && restoreControl && presentation !== 'hidden' && (\n <div\n class=\"kui-collapsible-panel__restore\"\n data-panel-restore={id}\n data-position={restorePosition}\n >\n {restoreControl}\n </div>\n )}\n </>\n );\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -11,13 +11,13 @@ export { ListItem, ListItemProps } from './list-item.js';
|
|
|
11
11
|
export { LoadingSpinner, LoadingSpinnerProps } from './loading-spinner.js';
|
|
12
12
|
export { LucideIcon, LucideIconProps, LucideNode } from './lucide-icon.js';
|
|
13
13
|
export { Pane, PaneContentElement, PaneElement, PaneProps, PaneSeparatorSide } from './pane.js';
|
|
14
|
-
export {
|
|
15
|
-
export { ResizableRegion, ResizableRegionAxis, ResizableRegionEdge, ResizableRegionProps, clampRegionSize, resizeRegionFromPointer } from './resizable-region.js';
|
|
14
|
+
export { ResizableRegion, ResizableRegionAxis, ResizableRegionCollapseMotion, ResizableRegionContentOverflow, ResizableRegionEdge, ResizableRegionPresentation, ResizableRegionProps, ResizableRegionRestorePosition, ResizableRegionSeparator, clampRegionSize, resizeRegionFromPointer } from './resizable-region.js';
|
|
16
15
|
export { SegmentedControl, SegmentedControlAppearance, SegmentedControlChoice, SegmentedControlLayout, SegmentedControlProps, SegmentedControlShape, SegmentedControlSize } from './segmented-control.js';
|
|
17
16
|
export { Select, SelectChoice, SelectProps } from './select.js';
|
|
18
17
|
export { Skeleton, SkeletonProps } from './skeleton.js';
|
|
19
18
|
export { StateBanner, StateBannerProps, StateBannerTone, StateBannerUrgency } from './state-banner.js';
|
|
20
19
|
export { SunkenPanel, SunkenPanelProps, SunkenPanelShape } from './sunken-panel.js';
|
|
20
|
+
export { DialogSurface, DialogSurfacePresentation, DialogSurfaceProps, DialogSurfaceSize, PopupSurface, PopupSurfaceInset, PopupSurfaceProps, SurfaceInset } from './surface-scaffold.js';
|
|
21
21
|
export { TabActivation, TabBar, TabBarProps } from './tab-bar.js';
|
|
22
22
|
export { TokenSearchEditorAttributes, TokenSearchField, TokenSearchFieldProps, TokenSearchFieldValue, TokenSearchToken, placeTokenSearchCaret, readTokenSearchField } from './token-search-field.js';
|
|
23
23
|
export { Toolbar, ToolbarProps } from './toolbar.js';
|
package/dist/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
export { reorderTabs, wireTabBars } from './chunk-UKKSMZYT.js';
|
|
2
|
-
export { wireTokenSearchFields } from './chunk-
|
|
2
|
+
export { wireTokenSearchFields } from './chunk-JFGXQBIP.js';
|
|
3
3
|
export { ValueTable, ValueTableRow } from './chunk-KWWR5VMS.js';
|
|
4
|
-
export { wireResizableRegions } from './chunk-
|
|
4
|
+
export { wireResizableRegions } from './chunk-YMKH5XTF.js';
|
|
5
5
|
export { StateBanner } from './chunk-W5L2JSBY.js';
|
|
6
6
|
export { SunkenPanel } from './chunk-TB6DY7H5.js';
|
|
7
|
-
export {
|
|
7
|
+
export { DialogSurface, PopupSurface } from './chunk-OBLTAKSX.js';
|
|
8
|
+
export { TabBar } from './chunk-X2U3QJCJ.js';
|
|
8
9
|
export { TokenSearchField, placeTokenSearchCaret, readTokenSearchField } from './chunk-7KEUJIIC.js';
|
|
9
|
-
export { PanelHeader } from './chunk-7XRDUG4Y.js';
|
|
10
10
|
export { ToolbarText } from './chunk-R7ZWUN64.js';
|
|
11
|
-
export { ResizableRegion, clampRegionSize, resizeRegionFromPointer } from './chunk-
|
|
11
|
+
export { ResizableRegion, clampRegionSize, resizeRegionFromPointer } from './chunk-HP2B2L26.js';
|
|
12
12
|
export { SegmentedControl } from './chunk-IJBSZ4NX.js';
|
|
13
|
-
export { Select } from './chunk-
|
|
14
|
-
export { ListActionRow } from './chunk-
|
|
13
|
+
export { Select } from './chunk-FRVS5RFM.js';
|
|
14
|
+
export { ListActionRow } from './chunk-VCE4MPVE.js';
|
|
15
15
|
export { ListInsetControl } from './chunk-QO55FN2Y.js';
|
|
16
16
|
export { ListInsetText } from './chunk-FEY65TBV.js';
|
|
17
|
-
export { AppTab } from './chunk-
|
|
18
|
-
export { Pane } from './chunk-JRKSK2HX.js';
|
|
17
|
+
export { AppTab } from './chunk-OT6RPYAP.js';
|
|
19
18
|
export { Toolbar } from './chunk-SYDMYBPG.js';
|
|
20
|
-
export { ToolbarControlGroup } from './chunk-
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
19
|
+
export { ToolbarControlGroup } from './chunk-WNWD54GR.js';
|
|
20
|
+
export { Pane } from './chunk-JRKSK2HX.js';
|
|
21
|
+
export { ListHeader } from './chunk-GWEAPEZI.js';
|
|
22
|
+
export { ListItem } from './chunk-4EF2CMYS.js';
|
|
23
23
|
export { List } from './chunk-J5BFYY7Q.js';
|
|
24
24
|
|
|
25
25
|
export { Skeleton } from './chunk-RKVQEH4J.js';
|
|
@@ -6,6 +6,10 @@ type ListActionRowRootAttributes = Readonly<Record<`data-${string}`, string | un
|
|
|
6
6
|
'data-item-id'?: never;
|
|
7
7
|
'data-has-icon'?: never;
|
|
8
8
|
'data-multiline'?: never;
|
|
9
|
+
'data-density'?: never;
|
|
10
|
+
'data-divider'?: never;
|
|
11
|
+
'data-busy'?: never;
|
|
12
|
+
'data-trailing-visibility'?: never;
|
|
9
13
|
'data-state'?: never;
|
|
10
14
|
'data-selected'?: never;
|
|
11
15
|
'data-pressed'?: never;
|
|
@@ -22,6 +26,11 @@ type ListActionRowTrailingAttributes = Readonly<Record<`data-${string}`, string
|
|
|
22
26
|
interface ListActionRowProps {
|
|
23
27
|
/** Visible dormant content for the primary button. Must not contain interactive descendants. */
|
|
24
28
|
label: string | SafeHtml;
|
|
29
|
+
description?: string | SafeHtml;
|
|
30
|
+
status?: string | SafeHtml;
|
|
31
|
+
busy?: boolean;
|
|
32
|
+
density?: 'standard' | 'compact';
|
|
33
|
+
divider?: 'none' | 'before' | 'after' | 'both';
|
|
25
34
|
/** Decorative dormant content for the primary button. Must not contain interactive descendants. */
|
|
26
35
|
icon?: SafeHtml;
|
|
27
36
|
action: string;
|
|
@@ -42,11 +51,12 @@ interface ListActionRowProps {
|
|
|
42
51
|
trailingActionIcon: SafeHtml;
|
|
43
52
|
trailingActionDisabled?: boolean;
|
|
44
53
|
trailingActionTitle?: string;
|
|
54
|
+
trailingActionVisibility?: 'always' | 'interaction';
|
|
45
55
|
className?: string;
|
|
46
56
|
style?: string;
|
|
47
57
|
rootAttributes?: ListActionRowRootAttributes;
|
|
48
58
|
trailingActionAttributes?: ListActionRowTrailingAttributes;
|
|
49
59
|
}
|
|
50
|
-
declare function ListActionRow({ label, icon, action, itemId, selected, pressed, accessibleLabel, title, multiline, state, disabled, tabIndex, placeholder, trailingAction, trailingActionLabel, trailingActionIcon, trailingActionDisabled, trailingActionTitle, className, style, rootAttributes, trailingActionAttributes, }: ListActionRowProps): SafeHtml;
|
|
60
|
+
declare function ListActionRow({ label, description, status, busy, density, divider, icon, action, itemId, selected, pressed, accessibleLabel, title, multiline, state, disabled, tabIndex, placeholder, trailingAction, trailingActionLabel, trailingActionIcon, trailingActionDisabled, trailingActionTitle, trailingActionVisibility, className, style, rootAttributes, trailingActionAttributes, }: ListActionRowProps): SafeHtml;
|
|
51
61
|
|
|
52
62
|
export { ListActionRow, type ListActionRowProps };
|
package/dist/list-action-row.js
CHANGED
package/dist/list-header.d.ts
CHANGED
|
@@ -5,6 +5,9 @@ type ListHeaderRootAttributes = Readonly<Record<`data-${string}`, string | undef
|
|
|
5
5
|
'data-action'?: never;
|
|
6
6
|
'data-has-badge'?: never;
|
|
7
7
|
'data-has-count'?: never;
|
|
8
|
+
'data-density'?: never;
|
|
9
|
+
'data-divider'?: never;
|
|
10
|
+
'data-indicator-tone'?: never;
|
|
8
11
|
'data-toggle'?: never;
|
|
9
12
|
}>;
|
|
10
13
|
type ListHeaderTriggerAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
|
|
@@ -16,6 +19,9 @@ type ListHeaderTriggerAttributes = Readonly<Record<`data-${string}`, string | un
|
|
|
16
19
|
}>;
|
|
17
20
|
interface ListHeaderBaseProps {
|
|
18
21
|
label: string;
|
|
22
|
+
density?: 'standard' | 'compact';
|
|
23
|
+
divider?: 'none' | 'before' | 'after' | 'both';
|
|
24
|
+
indicatorTone?: 'neutral' | 'accent' | 'danger';
|
|
19
25
|
/** Render as an unanimated loading skeleton: keep the label and action affordance, disable interaction. */
|
|
20
26
|
placeholder?: boolean;
|
|
21
27
|
rootAttributes?: ListHeaderRootAttributes;
|
|
@@ -53,12 +59,19 @@ type ListHeaderIndicatorProps = {
|
|
|
53
59
|
count: number;
|
|
54
60
|
countLabel: string;
|
|
55
61
|
badge?: never;
|
|
62
|
+
status?: never;
|
|
56
63
|
} | {
|
|
57
64
|
count?: never;
|
|
58
65
|
countLabel?: never;
|
|
59
|
-
badge
|
|
66
|
+
badge: SafeHtml;
|
|
67
|
+
status?: never;
|
|
68
|
+
} | {
|
|
69
|
+
count?: never;
|
|
70
|
+
countLabel?: never;
|
|
71
|
+
badge?: never;
|
|
72
|
+
status?: SafeHtml;
|
|
60
73
|
};
|
|
61
74
|
type ListHeaderProps = ListHeaderBaseProps & ListHeaderIndicatorProps & ListHeaderModeProps;
|
|
62
|
-
declare function ListHeader({ label, count, countLabel, badge, action, actionLabel, actionIcon, actionDisabled, disabledReason, expanded, toggle, placeholder, rootAttributes, triggerAttributes, }: ListHeaderProps): SafeHtml;
|
|
75
|
+
declare function ListHeader({ label, count, countLabel, badge, status, density, divider, indicatorTone, action, actionLabel, actionIcon, actionDisabled, disabledReason, expanded, toggle, placeholder, rootAttributes, triggerAttributes, }: ListHeaderProps): SafeHtml;
|
|
63
76
|
|
|
64
77
|
export { ListHeader, type ListHeaderProps };
|
package/dist/list-header.js
CHANGED
package/dist/list-item.d.ts
CHANGED
|
@@ -6,12 +6,23 @@ type ListItemRootAttributes = Readonly<Record<`data-${string}`, string | undefin
|
|
|
6
6
|
'data-item-id'?: never;
|
|
7
7
|
'data-has-icon'?: never;
|
|
8
8
|
'data-multiline'?: never;
|
|
9
|
+
'data-density'?: never;
|
|
10
|
+
'data-divider'?: never;
|
|
11
|
+
'data-busy'?: never;
|
|
9
12
|
'data-state'?: never;
|
|
10
13
|
}>;
|
|
11
14
|
interface ListItemProps {
|
|
12
15
|
label: string | SafeHtml;
|
|
16
|
+
/** App-owned supporting text rendered in the component's stable label stack. */
|
|
17
|
+
description?: string | SafeHtml;
|
|
13
18
|
icon?: SafeHtml;
|
|
14
19
|
trailing?: SafeHtml;
|
|
20
|
+
/** Dormant status metadata rendered before trailing content. */
|
|
21
|
+
status?: string | SafeHtml;
|
|
22
|
+
/** Show a progress indicator and expose the row as busy without replacing its content. */
|
|
23
|
+
busy?: boolean;
|
|
24
|
+
density?: 'standard' | 'compact';
|
|
25
|
+
divider?: 'none' | 'before' | 'after' | 'both';
|
|
15
26
|
selected?: boolean;
|
|
16
27
|
action: string;
|
|
17
28
|
itemId?: string;
|
|
@@ -28,6 +39,6 @@ interface ListItemProps {
|
|
|
28
39
|
placeholder?: boolean;
|
|
29
40
|
rootAttributes?: ListItemRootAttributes;
|
|
30
41
|
}
|
|
31
|
-
declare function ListItem({ label, icon, trailing, selected, action, itemId, className, style, pressed, accessibleLabel, title, multiline, state, disabled, tabIndex, placeholder, rootAttributes, }: ListItemProps): SafeHtml;
|
|
42
|
+
declare function ListItem({ label, description, icon, trailing, status, busy, density, divider, selected, action, itemId, className, style, pressed, accessibleLabel, title, multiline, state, disabled, tabIndex, placeholder, rootAttributes, }: ListItemProps): SafeHtml;
|
|
32
43
|
|
|
33
44
|
export { ListItem, type ListItemProps };
|
package/dist/list-item.js
CHANGED
|
@@ -2,6 +2,11 @@ import { SafeHtml } from 'kerfjs';
|
|
|
2
2
|
|
|
3
3
|
type ResizableRegionAxis = 'horizontal' | 'vertical';
|
|
4
4
|
type ResizableRegionEdge = 'start' | 'end';
|
|
5
|
+
type ResizableRegionSeparator = 'auto' | 'hidden';
|
|
6
|
+
type ResizableRegionCollapseMotion = 'none' | 'slide' | 'fade-slide';
|
|
7
|
+
type ResizableRegionContentOverflow = 'clip' | 'auto' | 'visible';
|
|
8
|
+
type ResizableRegionPresentation = 'inline' | 'overlay' | 'hidden';
|
|
9
|
+
type ResizableRegionRestorePosition = 'bottom-start' | 'bottom-end';
|
|
5
10
|
interface ResizableRegionProps {
|
|
6
11
|
id: string;
|
|
7
12
|
label: string;
|
|
@@ -12,12 +17,24 @@ interface ResizableRegionProps {
|
|
|
12
17
|
edge?: ResizableRegionEdge;
|
|
13
18
|
collapsed?: boolean;
|
|
14
19
|
transitioning?: boolean;
|
|
20
|
+
/** Whether the separator line is painted. The resize hit target remains available. */
|
|
21
|
+
separator?: ResizableRegionSeparator;
|
|
22
|
+
/** Keep the track change instant while optionally sliding the fixed-size content. */
|
|
23
|
+
collapseMotion?: ResizableRegionCollapseMotion;
|
|
24
|
+
/** Overflow policy for content such as an open popup inside a bottom drawer. */
|
|
25
|
+
contentOverflow?: ResizableRegionContentOverflow;
|
|
26
|
+
/** Inline layout, an edge overlay, or a responsive replacement that removes the region. */
|
|
27
|
+
presentation?: ResizableRegionPresentation;
|
|
28
|
+
/** Always-available control rendered while collapsed, outside the clipped region. */
|
|
29
|
+
restoreControl?: SafeHtml;
|
|
30
|
+
/** Safe-area-aware viewport corner for `restoreControl`. */
|
|
31
|
+
restorePosition?: ResizableRegionRestorePosition;
|
|
15
32
|
/** Decorative dormant content for the separator handle. Must not contain interactive descendants. */
|
|
16
33
|
handleIcon?: SafeHtml;
|
|
17
34
|
children: SafeHtml | SafeHtml[];
|
|
18
35
|
}
|
|
19
36
|
declare const clampRegionSize: (size: number, min: number, max: number) => number;
|
|
20
37
|
declare const resizeRegionFromPointer: (startSize: number, delta: number, edge: ResizableRegionEdge) => number;
|
|
21
|
-
declare function ResizableRegion({ id, label, size, min, max, axis, edge, collapsed, transitioning, handleIcon, children, }: ResizableRegionProps): SafeHtml;
|
|
38
|
+
declare function ResizableRegion({ id, label, size, min, max, axis, edge, collapsed, transitioning, separator, collapseMotion, contentOverflow, presentation, restoreControl, restorePosition, handleIcon, children, }: ResizableRegionProps): SafeHtml;
|
|
22
39
|
|
|
23
|
-
export { ResizableRegion, type ResizableRegionAxis, type ResizableRegionEdge, type ResizableRegionProps, clampRegionSize, resizeRegionFromPointer };
|
|
40
|
+
export { ResizableRegion, type ResizableRegionAxis, type ResizableRegionCollapseMotion, type ResizableRegionContentOverflow, type ResizableRegionEdge, type ResizableRegionPresentation, type ResizableRegionProps, type ResizableRegionRestorePosition, type ResizableRegionSeparator, clampRegionSize, resizeRegionFromPointer };
|
package/dist/resizable-region.js
CHANGED