@kerfjs/ui 5.0.0-beta.118 → 5.0.0-beta.119

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.
@@ -8151,6 +8151,7 @@
8151
8151
  "state mapping",
8152
8152
  "message lifetime",
8153
8153
  "retry behavior",
8154
+ "stable identity for conditional siblings",
8154
8155
  "copy"
8155
8156
  ],
8156
8157
  "variants": [
@@ -6514,6 +6514,11 @@
6514
6514
  { "id": "state mapping", "owner": "application", "required": false },
6515
6515
  { "id": "message lifetime", "owner": "application", "required": false },
6516
6516
  { "id": "retry behavior", "owner": "application", "required": false },
6517
+ {
6518
+ "id": "stable identity for conditional siblings",
6519
+ "owner": "application",
6520
+ "required": false
6521
+ },
6517
6522
  { "id": "copy", "owner": "application", "required": false }
6518
6523
  ],
6519
6524
  "wiring": {
@@ -64,7 +64,7 @@ Zones (a zone is bound to JSX only through its listed prop; never assume the zon
64
64
 
65
65
  ## State and wiring
66
66
 
67
- **The app owns:** badge content; state mapping; message lifetime; retry behavior; copy.
67
+ **The app owns:** badge content; state mapping; message lifetime; retry behavior; stable identity for conditional siblings; copy.
68
68
 
69
69
  No wiring helper.
70
70
 
@@ -1,6 +1,6 @@
1
1
  # Public API signatures for the UI authoring corpus
2
2
 
3
- Generated from emitted declarations for `@kerfjs/ui@5.0.0-beta.118` and `kerfjs@5.0.0-beta.118`. This bounded reference covers only APIs used by the seven-task corpus. It is interface evidence, not an implementation or runtime guarantee.
3
+ Generated from emitted declarations for `@kerfjs/ui@5.0.0-beta.119` and `kerfjs@5.0.0-beta.119`. This bounded reference covers only APIs used by the seven-task corpus. It is interface evidence, not an implementation or runtime guarantee.
4
4
 
5
5
  ## `@kerfjs/ui/css-values`
6
6
 
@@ -3901,6 +3901,15 @@ type StateBannerUrgency = 'status' | 'alert';
3901
3901
  type StateBannerCopyLayout = 'inline' | 'stacked';
3902
3902
  type StateBannerActionPlacement = 'trailing' | 'below';
3903
3903
  type StateBannerPresentation = 'card' | 'strip';
3904
+ /** Application `data-*` identity on the banner root; component markers stay protected. */
3905
+ type StateBannerRootAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
3906
+ 'data-component'?: never;
3907
+ 'data-tone'?: never;
3908
+ 'data-copy-layout'?: never;
3909
+ 'data-action-placement'?: never;
3910
+ 'data-presentation'?: never;
3911
+ 'data-placeholder'?: never;
3912
+ }>;
3904
3913
  interface StateBannerProps {
3905
3914
  title: string;
3906
3915
  detail?: string;
@@ -3933,14 +3942,16 @@ interface StateBannerProps {
3933
3942
  */
3934
3943
  dividerSides?: Sides;
3935
3944
  className?: string;
3945
+ /** Safe `data-*` identity, such as `data-key` for conditional siblings. */
3946
+ rootAttributes?: StateBannerRootAttributes;
3936
3947
  /** Render the title, badge, and detail as unanimated loading skeletons, keeping the icon and tone. The detail line appears only when `detail` is set, as in the live banner. */
3937
3948
  placeholder?: boolean;
3938
3949
  /** Native named-slot assignment when composed inside a web component. */
3939
3950
  slot?: string;
3940
3951
  }
3941
- declare function StateBanner({ title, detail, badge, icon, action, tone, urgency, copyLayout, actionPlacement, presentation, dividerSides, className, placeholder, slot, }: StateBannerProps): SafeHtml;
3952
+ declare function StateBanner({ title, detail, badge, icon, action, tone, urgency, copyLayout, actionPlacement, presentation, dividerSides, className, rootAttributes, placeholder, slot, }: StateBannerProps): SafeHtml;
3942
3953
 
3943
- export { SemanticTone, StateBanner, type StateBannerActionPlacement, type StateBannerCopyLayout, type StateBannerPresentation, type StateBannerProps, type StateBannerTone, type StateBannerUrgency };
3954
+ export { SemanticTone, StateBanner, type StateBannerActionPlacement, type StateBannerCopyLayout, type StateBannerPresentation, type StateBannerProps, type StateBannerRootAttributes, type StateBannerTone, type StateBannerUrgency };
3944
3955
  ```
3945
3956
 
3946
3957
  ## `@kerfjs/ui/empty-state`
@@ -6288,6 +6299,8 @@ import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
6288
6299
  type TextFieldSize = 'default' | 'compact';
6289
6300
  /** The kinds of single-line value a TextField takes. */
6290
6301
  type TextFieldType = 'text' | 'email' | 'password' | 'search' | 'url' | 'tel' | 'number' | 'date';
6302
+ /** Native virtual-keyboard hint for an input or textarea. */
6303
+ type TextFieldInputMode = 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';
6291
6304
  /** Application `data-*` metadata; the TextField's own markers stay protected. */
6292
6305
  type TextFieldRootAttributes = Readonly<Record<`data-${string}`, string | undefined>>;
6293
6306
  /**
@@ -6354,6 +6367,14 @@ interface TextFieldOptions {
6354
6367
  /** Request native focus on insertion or when the containing dialog opens. */
6355
6368
  autofocus?: boolean;
6356
6369
  autocomplete?: string;
6370
+ /** Native capitalization behavior for exact or prose entry. */
6371
+ autocapitalize?: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters';
6372
+ /** Native autocorrection hint. */
6373
+ autocorrect?: 'on' | 'off';
6374
+ /** Native virtual-keyboard hint. */
6375
+ inputMode?: TextFieldInputMode;
6376
+ /** Native spelling check; serialized as the enumerated HTML value. */
6377
+ spellcheck?: boolean;
6357
6378
  /** The input's id, for an external label or form. */
6358
6379
  id?: string;
6359
6380
  className?: string;
@@ -6369,9 +6390,9 @@ interface TextFieldOptions {
6369
6390
  * The whole field is one `<label>`, so clicking anywhere on it focuses the
6370
6391
  * input; the input is named by `label` (or `ariaLabel`) directly.
6371
6392
  */
6372
- declare function TextField({ label, ariaLabel, value, name, placeholder, hint, error, size, icon, clearable, clearLabel, maxLength, showCount, type, min, max, step, multiline, rows, maxRows, disabled, readOnly, required, autofocus, autocomplete, id, className, rootAttributes, slot, }: TextFieldProps): kerfjs.SafeHtml;
6393
+ declare function TextField({ label, ariaLabel, value, name, placeholder, hint, error, size, icon, clearable, clearLabel, maxLength, showCount, type, min, max, step, multiline, rows, maxRows, disabled, readOnly, required, autofocus, autocomplete, autocapitalize, autocorrect, inputMode, spellcheck, id, className, rootAttributes, slot, }: TextFieldProps): kerfjs.SafeHtml;
6373
6394
 
6374
- export { TextField, type TextFieldName, type TextFieldOptions, type TextFieldProps, type TextFieldRootAttributes, type TextFieldSize, type TextFieldType };
6395
+ export { TextField, type TextFieldInputMode, type TextFieldName, type TextFieldOptions, type TextFieldProps, type TextFieldRootAttributes, type TextFieldSize, type TextFieldType };
6375
6396
  ```
6376
6397
 
6377
6398
  ## `@kerfjs/ui/checkbox`
package/ai/skill.md CHANGED
@@ -57,6 +57,10 @@ Use `info` for the role backed by the existing `--kui-color-brand-*` tokens.
57
57
  Migrate Badge/Chip `tone="brand"` to `tone="info"`; `BadgeTone` and
58
58
  `StateBannerTone` remain deprecated aliases of `SemanticTone`.
59
59
 
60
+ When conditional `StateBanner` siblings share a parent, give each a stable
61
+ `rootAttributes={{ 'data-key': key }}` so removing an earlier status keeps a
62
+ surviving banner's action and focus on the same DOM nodes.
63
+
60
64
  ### Lowered surfaces are translucent
61
65
 
62
66
  The sunken/lowered background is a semi-transparent color, not a solid canvas.
@@ -1,6 +1,6 @@
1
1
  # Web Awesome JSX signatures for the UI authoring corpus
2
2
 
3
- Generated from the emitted `@kerfjs/ui@5.0.0-beta.118` declaration boundary. Import `@kerfjs/ui/webawesome` for type effects when authoring direct `wa-*` JSX. The module emits no runtime behavior and does not register custom elements.
3
+ Generated from the emitted `@kerfjs/ui@5.0.0-beta.119` declaration boundary. Import `@kerfjs/ui/webawesome` for type effects when authoring direct `wa-*` JSX. The module emits no runtime behavior and does not register custom elements.
4
4
 
5
5
  ```ts
6
6
  import { KerfCustomElement } from 'kerfjs/jsx-runtime';
@@ -1,8 +1,17 @@
1
1
  import { Skeleton } from './chunk-CVD5IZGB.js';
2
2
  import { Badge } from './chunk-RMWNO6BA.js';
3
3
  import { em } from './chunk-IQSRHXZR.js';
4
+ import { filterDataAttributes } from './chunk-KH4KEMSP.js';
4
5
  import { jsxs, jsx } from 'kerfjs/jsx-runtime';
5
6
 
7
+ var STATE_BANNER_PROTECTED = /* @__PURE__ */ new Set([
8
+ "data-component",
9
+ "data-tone",
10
+ "data-copy-layout",
11
+ "data-action-placement",
12
+ "data-presentation",
13
+ "data-placeholder"
14
+ ]);
6
15
  function StateBanner({
7
16
  title,
8
17
  detail,
@@ -16,12 +25,14 @@ function StateBanner({
16
25
  presentation = "card",
17
26
  dividerSides = "b",
18
27
  className = "",
28
+ rootAttributes = {},
19
29
  placeholder = false,
20
30
  slot
21
31
  }) {
22
32
  return /* @__PURE__ */ jsxs(
23
33
  "section",
24
34
  {
35
+ ...filterDataAttributes(rootAttributes, STATE_BANNER_PROTECTED),
25
36
  class: `kui-state-banner ${className}`.trim(),
26
37
  "data-component": "state-banner",
27
38
  "data-tone": tone,
@@ -49,4 +60,4 @@ function StateBanner({
49
60
 
50
61
  export { StateBanner };
51
62
 
52
- //# sourceMappingURL=chunk-2FW7D4IG.js.map
63
+ //# sourceMappingURL=chunk-C2ZO3OZZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/feedback/state-banner/state-banner.tsx"],"names":[],"mappings":";;;;;;AAkBA,IAAM,sBAAA,uBAA6B,GAAA,CAAI;AAAA,EACrC,gBAAA;AAAA,EACA,WAAA;AAAA,EACA,kBAAA;AAAA,EACA,uBAAA;AAAA,EACA,mBAAA;AAAA,EACA;AACF,CAAC,CAAA;AAsDM,SAAS,WAAA,CAAY;AAAA,EAC1B,KAAA;AAAA,EACA,MAAA;AAAA,EACA,KAAA;AAAA,EACA,IAAA;AAAA,EACA,MAAA;AAAA,EACA,IAAA,GAAO,MAAA;AAAA,EACP,OAAA,GAAU,QAAA;AAAA,EACV,UAAA,GAAa,QAAA;AAAA,EACb,eAAA,GAAkB,UAAA;AAAA,EAClB,YAAA,GAAe,MAAA;AAAA,EACf,YAAA,GAAe,GAAA;AAAA,EACf,SAAA,GAAY,EAAA;AAAA,EACZ,iBAAiB,EAAC;AAAA,EAClB,WAAA,GAAc,KAAA;AAAA,EACd;AACF,CAAA,EAAqB;AACnB,EAAA,uBACE,IAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAA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,EACV,8BAAC,MAAA,EAAA,EAAM,QAAA,EAAA,WAAA,mBAAc,GAAA,CAAC,QAAA,EAAA,EAAS,OAAO,EAAA,CAAG,EAAE,CAAA,EAAG,CAAA,GAAK,QAAO,CAAA,EAC5D;AAAA,SAAA,EAEJ,CAAA;AAAA,QACC,MAAA,oBAAU,GAAA,CAAC,KAAA,EAAA,EAAI,KAAA,EAAM,4BAA4B,QAAA,EAAA,MAAA,EAAO;AAAA;AAAA;AAAA,GAC3D;AAEJ","file":"chunk-C2ZO3OZZ.js","sourcesContent":["import type { SafeHtml } from 'kerfjs';\n\nimport type { KerfUiContent } from '../../../shared/content/semantic-content.js';\nimport { filterDataAttributes } from '../../../shared/dom/extension-attributes.js';\nimport type { Sides } from '../../../shared/layout/sides.js';\nimport { em } from '../../../shared/styles/css-values.js';\nimport type { SemanticTone } from '../../../shared/styles/semantic-tone.js';\nimport { Badge } from '../badge/badge.js';\nimport { Skeleton } from '../skeleton/skeleton.js';\n\nexport type { SemanticTone } from '../../../shared/styles/semantic-tone.js';\n/** @deprecated Use SemanticTone. */\nexport type StateBannerTone = SemanticTone;\nexport type StateBannerUrgency = 'status' | 'alert';\nexport type StateBannerCopyLayout = 'inline' | 'stacked';\nexport type StateBannerActionPlacement = 'trailing' | 'below';\nexport type StateBannerPresentation = 'card' | 'strip';\n\nconst STATE_BANNER_PROTECTED = new Set([\n 'data-component',\n 'data-tone',\n 'data-copy-layout',\n 'data-action-placement',\n 'data-presentation',\n 'data-placeholder',\n]);\n\n/** Application `data-*` identity on the banner root; component markers stay protected. */\nexport type StateBannerRootAttributes = Readonly<\n Record<`data-${string}`, string | undefined> & {\n 'data-component'?: never;\n 'data-tone'?: never;\n 'data-copy-layout'?: never;\n 'data-action-placement'?: never;\n 'data-presentation'?: never;\n 'data-placeholder'?: never;\n }\n>;\n\nexport interface StateBannerProps {\n title: string;\n detail?: string;\n /** Optional compact status or count shown beside the title. */\n badge?: string;\n icon?: SafeHtml;\n action?: KerfUiContent;\n tone?: SemanticTone;\n urgency?: StateBannerUrgency;\n /** Keep the detail beside the title, or give it its own line. */\n copyLayout?: StateBannerCopyLayout;\n /**\n * `trailing` (the default) puts the action beside the copy while the copy\n * keeps its minimum readable width, and otherwise wraps it onto its own\n * end-aligned trailing row, at any viewport or container width. `below`\n * always gives the action that separate trailing row.\n */\n actionPlacement?: StateBannerActionPlacement;\n /**\n * `card` (the default) is an inset, rounded, fully bordered banner beside\n * the affected work. `strip` is a full-width band at a layout edge, such as\n * above a workspace: square corners, no inline margin, inline padding on the\n * shared content-text column, and only the tone-colored `dividerSides` edges.\n */\n presentation?: StateBannerPresentation;\n /**\n * Physical tone-colored divider edges of a `strip`, in canonical\n * top/right/bottom/left order. Defaults to the bottom edge; `''` draws none.\n * A `card` keeps its full border and ignores this.\n */\n dividerSides?: Sides;\n className?: string;\n /** Safe `data-*` identity, such as `data-key` for conditional siblings. */\n rootAttributes?: StateBannerRootAttributes;\n /** Render the title, badge, and detail as unanimated loading skeletons, keeping the icon and tone. The detail line appears only when `detail` is set, as in the live banner. */\n placeholder?: boolean;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n}\n\nexport function StateBanner({\n title,\n detail,\n badge,\n icon,\n action,\n tone = 'info',\n urgency = 'status',\n copyLayout = 'inline',\n actionPlacement = 'trailing',\n presentation = 'card',\n dividerSides = 'b',\n className = '',\n rootAttributes = {},\n placeholder = false,\n slot,\n}: StateBannerProps) {\n return (\n <section\n {...filterDataAttributes(rootAttributes, STATE_BANNER_PROTECTED)}\n class={`kui-state-banner ${className}`.trim()}\n data-component=\"state-banner\"\n data-tone={tone}\n data-copy-layout={copyLayout}\n data-action-placement={actionPlacement}\n data-presentation={presentation}\n divider-sides={\n presentation === 'strip' ? dividerSides || undefined : undefined\n }\n data-placeholder={placeholder ? 'true' : undefined}\n role={urgency}\n aria-live={urgency === 'alert' ? 'assertive' : 'polite'}\n aria-busy={placeholder ? 'true' : undefined}\n slot={slot}\n >\n {icon && <span class=\"kui-state-banner__icon\">{icon}</span>}\n <div class=\"kui-state-banner__copy\">\n <strong>{placeholder ? <Skeleton width={em(10)} /> : title}</strong>\n {badge && (\n <Badge appearance=\"solid\" size=\"compact\" tone={tone}>\n {placeholder ? <Skeleton width={em(1.75)} /> : badge}\n </Badge>\n )}\n {detail && (\n <span class=\"kui-state-banner__detail\">\n <span>{placeholder ? <Skeleton width={em(16)} /> : detail}</span>\n </span>\n )}\n </div>\n {action && <div class=\"kui-state-banner__action\">{action}</div>}\n </section>\n );\n}\n"]}
@@ -35,6 +35,10 @@ function TextField({
35
35
  required = false,
36
36
  autofocus = false,
37
37
  autocomplete,
38
+ autocapitalize,
39
+ autocorrect,
40
+ inputMode,
41
+ spellcheck,
38
42
  id,
39
43
  className = "",
40
44
  rootAttributes = {},
@@ -53,6 +57,10 @@ function TextField({
53
57
  required,
54
58
  autofocus,
55
59
  autocomplete,
60
+ autocapitalize,
61
+ autocorrect,
62
+ inputmode: inputMode,
63
+ spellcheck: spellcheck === void 0 ? void 0 : spellcheck ? "true" : "false",
56
64
  maxlength: maxLength,
57
65
  // The label element also wraps the clear button and the count, so the
58
66
  // input takes its name explicitly rather than from the label's text.
@@ -120,4 +128,4 @@ function TextField({
120
128
 
121
129
  export { TextField };
122
130
 
123
- //# sourceMappingURL=chunk-36HVQ72F.js.map
131
+ //# sourceMappingURL=chunk-N2K3QGSX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/forms/text-field/text-field.tsx"],"names":[],"mappings":";;;;;AAiBA,IAAM,oBAAA,uBAA2B,GAAA,CAAI;AAAA,EACnC,gBAAA;AAAA,EACA,WAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF,CAAC,CAAA;AA4FM,SAAS,SAAA,CAAU;AAAA,EACxB,KAAA;AAAA,EACA,SAAA;AAAA,EACA,KAAA;AAAA,EACA,IAAA;AAAA,EACA,WAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,IAAA,GAAO,SAAA;AA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CAAC,UAAA,EAAA,EAAW,IAAA,EAAM,OAAA,EAAS,MAAK,UAAA,EAAW;AAAA;AAAA,WAC7C,GACE;AAAA,SAAA,EACN,CAAA;AAAA,QACC,UAAU,MAAA,GACT,QAAA,mBAEA,IAAA,CAAC,MAAA,EAAA,EAAK,OAAM,wBAAA,EACT,QAAA,EAAA;AAAA,UAAA,QAAA;AAAA,8BACA,MAAA,EAAA,EAAK,KAAA,EAAM,uBAAA,EAAwB,uBAAA,EAAsB,IACvD,QAAA,EAAA,KAAA,EACH;AAAA,SAAA,EACF,CAAA;AAAA,QAED,KAAA,KAAU,SAAY,IAAA,mBACrB,GAAA,CAAC,UAAK,KAAA,EAAM,uBAAA,EAAwB,aAAA,EAAY,MAAA,EAC7C,QAAA,EAAA,KAAA,EACH;AAAA;AAAA;AAAA,GAEJ;AAEJ","file":"chunk-N2K3QGSX.js","sourcesContent":["import { CircleX } from 'lucide';\n\nimport type { KerfUiContent } from '../../../shared/content/semantic-content.js';\nimport { filterDataAttributes } from '../../../shared/dom/extension-attributes.js';\nimport { LucideIcon } from '../../media/lucide-icon/lucide-icon.js';\n\n/** `default` is the 44px control height; `compact` is 33px with smaller text. */\nexport type TextFieldSize = 'default' | 'compact';\n\n/** The kinds of single-line value a TextField takes. */\nexport type TextFieldType =\n 'text' | 'email' | 'password' | 'search' | 'url' | 'tel' | 'number' | 'date';\n\n/** Native virtual-keyboard hint for an input or textarea. */\nexport type TextFieldInputMode =\n 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';\n\nconst TEXT_FIELD_PROTECTED = new Set([\n 'data-component',\n 'data-size',\n 'data-invalid',\n 'data-multiline',\n]);\n\n/** Application `data-*` metadata; the TextField's own markers stay protected. */\nexport type TextFieldRootAttributes = Readonly<\n Record<`data-${string}`, string | undefined>\n>;\n\n/**\n * The field's accessible name: a visible `label`, or `ariaLabel` when the\n * surrounding content already names it.\n */\nexport type TextFieldName =\n { label: string; ariaLabel?: never } | { label?: never; ariaLabel: string };\n\nexport type TextFieldProps = TextFieldName & TextFieldOptions;\n\nexport interface TextFieldOptions {\n /** The controlled value. */\n value?: string;\n name?: string;\n placeholder?: string;\n /** Supporting text below the field, also its accessible description. */\n hint?: string;\n /**\n * A validation message: shown below the field in the danger color, added\n * to its description, and marking it `aria-invalid`.\n */\n error?: string;\n size?: TextFieldSize;\n /** A leading decorative icon, such as a `LucideIcon` (single-line only). */\n icon?: KerfUiContent;\n /**\n * A clear button while the field has a value (single-line only). Needs\n * `wireTextFields(root)`, which clears the field and announces `input`.\n */\n clearable?: boolean;\n /** The clear button's accessible name (default `Clear`). */\n clearLabel?: string;\n /** The most characters the field accepts (native `maxlength`). */\n maxLength?: number;\n /**\n * Show a live `count / maxLength` below the field. Needs `maxLength` and\n * `wireTextFields(root)`, which updates it as people type.\n */\n showCount?: boolean;\n /** Single-line value kind (default `text`); `date` uses the native picker. */\n type?: TextFieldType;\n /** Native lower bound for `type=\"number\"` (number or numeric string). */\n min?: number | string;\n /** Native upper bound for `type=\"number\"` (number or numeric string). */\n max?: number | string;\n /** Native number increment (number, numeric string, or `\"any\"`). */\n step?: number | string;\n /** A multi-line field: a `<textarea>`. */\n multiline?: boolean;\n /** A multi-line field's height in lines (default 3). */\n rows?: number;\n /**\n * Grow a multi-line field with its content from `rows` up to this many\n * lines, then scroll.\n */\n maxRows?: number;\n disabled?: boolean;\n readOnly?: boolean;\n required?: boolean;\n /** Request native focus on insertion or when the containing dialog opens. */\n autofocus?: boolean;\n autocomplete?: string;\n /** Native capitalization behavior for exact or prose entry. */\n autocapitalize?: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters';\n /** Native autocorrection hint. */\n autocorrect?: 'on' | 'off';\n /** Native virtual-keyboard hint. */\n inputMode?: TextFieldInputMode;\n /** Native spelling check; serialized as the enumerated HTML value. */\n spellcheck?: boolean;\n /** The input's id, for an external label or form. */\n id?: string;\n className?: string;\n /** Safe `data-*` metadata (a `data-key`). */\n rootAttributes?: TextFieldRootAttributes;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n}\n\n/**\n * A text input with its label above, an optional leading icon and clear\n * button, and supporting or error text below, at the 44px control height or\n * compact. `multiline` makes it a textarea that can grow with its content.\n * The whole field is one `<label>`, so clicking anywhere on it focuses the\n * input; the input is named by `label` (or `ariaLabel`) directly.\n */\nexport function TextField({\n label,\n ariaLabel,\n value,\n name,\n placeholder,\n hint,\n error,\n size = 'default',\n icon,\n clearable = false,\n clearLabel = 'Clear',\n maxLength,\n showCount = false,\n type = 'text',\n min,\n max,\n step,\n multiline = false,\n rows = 3,\n maxRows,\n disabled = false,\n readOnly = false,\n required = false,\n autofocus = false,\n autocomplete,\n autocapitalize,\n autocorrect,\n inputMode,\n spellcheck,\n id,\n className = '',\n rootAttributes = {},\n slot,\n}: TextFieldProps) {\n const description = [hint, error].filter(Boolean).join(' ') || undefined;\n const shared = {\n id,\n name,\n // A clearable field always has a placeholder, so CSS can hide its clear\n // button while the field is empty (`:placeholder-shown`); a blank one\n // shows nothing.\n placeholder: clearable && !multiline ? (placeholder ?? ' ') : placeholder,\n disabled,\n readonly: readOnly,\n required,\n autofocus,\n autocomplete,\n autocapitalize,\n autocorrect,\n inputmode: inputMode,\n spellcheck:\n spellcheck === undefined ? undefined : spellcheck ? 'true' : 'false',\n maxlength: maxLength,\n // The label element also wraps the clear button and the count, so the\n // input takes its name explicitly rather than from the label's text.\n 'aria-label': label ?? ariaLabel,\n 'aria-description': description,\n 'aria-invalid': error ? 'true' : undefined,\n } as const;\n const hintText =\n hint === undefined ? null : (\n <span class=\"kui-text-field__hint\" aria-hidden=\"true\">\n {hint}\n </span>\n );\n const count =\n showCount && maxLength !== undefined\n ? `${String((value ?? '').length)} / ${String(maxLength)}`\n : undefined;\n const style = [\n multiline ? `--_kui-text-field-rows:${String(rows)}` : '',\n multiline && maxRows !== undefined\n ? `--_kui-text-field-max-rows:${String(Math.max(rows, maxRows))}`\n : '',\n ]\n .filter(Boolean)\n .join(';');\n return (\n <label\n {...filterDataAttributes(rootAttributes, TEXT_FIELD_PROTECTED)}\n class={`kui-text-field ${className}`.trim()}\n data-component=\"text-field\"\n data-size={size}\n data-invalid={error ? '' : undefined}\n data-multiline={\n multiline ? (maxRows === undefined ? '' : 'grow') : undefined\n }\n style={style || undefined}\n slot={slot}\n >\n {label === undefined ? null : (\n <span class=\"kui-text-field__label\" aria-hidden=\"true\">\n {label}\n {required ? (\n <span class=\"kui-text-field__required\" aria-hidden=\"true\">\n *\n </span>\n ) : null}\n </span>\n )}\n <span class=\"kui-text-field__box\">\n {icon === undefined || multiline ? null : (\n <span class=\"kui-text-field__icon\" aria-hidden=\"true\">\n {icon}\n </span>\n )}\n {multiline ? (\n <textarea {...shared} class=\"kui-text-field__input\" rows={rows}>\n {value ?? ''}\n </textarea>\n ) : (\n <input\n {...shared}\n class=\"kui-text-field__input\"\n type={type}\n value={value}\n min={type === 'number' ? min : undefined}\n max={type === 'number' ? max : undefined}\n step={type === 'number' ? step : undefined}\n />\n )}\n {clearable && !multiline ? (\n <button\n type=\"button\"\n class=\"kui-text-field__clear\"\n aria-label={clearLabel}\n data-text-field-clear=\"\"\n disabled={disabled || readOnly}\n >\n <LucideIcon icon={CircleX} name=\"circle-x\" />\n </button>\n ) : null}\n </span>\n {count === undefined ? (\n hintText\n ) : (\n <span class=\"kui-text-field__footer\">\n {hintText}\n <span class=\"kui-text-field__count\" data-text-field-count=\"\">\n {count}\n </span>\n </span>\n )}\n {error === undefined ? null : (\n <span class=\"kui-text-field__error\" aria-hidden=\"true\">\n {error}\n </span>\n )}\n </label>\n );\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -25,7 +25,7 @@ export { EdgeActivityIndicator, EdgeActivityIndicatorProps } from './edge-activi
25
25
  export { EmptyState, EmptyStateProps } from './empty-state.js';
26
26
  export { LoadingSpinner, LoadingSpinnerProps } from './loading-spinner.js';
27
27
  export { Skeleton, SkeletonProps } from './skeleton.js';
28
- export { StateBanner, StateBannerProps, StateBannerTone, StateBannerUrgency } from './state-banner.js';
28
+ export { StateBanner, StateBannerProps, StateBannerRootAttributes, StateBannerTone, StateBannerUrgency } from './state-banner.js';
29
29
  export { Checkbox, CheckboxProps, CheckboxRootAttributes, CheckboxSize } from './checkbox.js';
30
30
  export { wireCheckboxes } from './wire-checkboxes.js';
31
31
  export { CheckboxGroup, CheckboxGroupChoice, CheckboxGroupName, CheckboxGroupOptions, CheckboxGroupOrientation, CheckboxGroupProps, CheckboxGroupRootAttributes, CheckboxGroupSize } from './checkbox-group.js';
@@ -44,7 +44,7 @@ export { SearchFieldCollapsibleOptions, SearchFieldEdit, SearchFieldSubmit, Sear
44
44
  export { SegmentedControl, SegmentedControlAppearance, SegmentedControlChoice, SegmentedControlLayout, SegmentedControlProps, SegmentedControlShape, SegmentedControlSize } from './segmented-control.js';
45
45
  export { Select, SelectChoice, SelectFocusRingOwner, SelectPresentation, SelectProps, SelectSelectedPresentation, SelectSize } from './select.js';
46
46
  export { Switch, SwitchProps, SwitchRootAttributes, SwitchSize } from './switch.js';
47
- export { TextField, TextFieldName, TextFieldOptions, TextFieldProps, TextFieldRootAttributes, TextFieldSize, TextFieldType } from './text-field.js';
47
+ export { TextField, TextFieldInputMode, TextFieldName, TextFieldOptions, TextFieldProps, TextFieldRootAttributes, TextFieldSize, TextFieldType } from './text-field.js';
48
48
  export { wireTextFields } from './wire-text-fields.js';
49
49
  export { ColumnTrack, ColumnTrackLayout, ColumnTrackProps } from './column-track.js';
50
50
  export { ContentSwap, ContentSwapDirection, ContentSwapProps, ContentSwapSide, ContentSwapTransition } from './content-swap.js';
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ export { wireCheckboxes } from './chunk-CNM6ZWP2.js';
14
14
  export { readChoiceChips, wireChoiceChips } from './chunk-K57NINLH.js';
15
15
  export { wireComboboxes } from './chunk-MVKHSAKE.js';
16
16
  export { wireCornerStatus } from './chunk-ZKKO4MHC.js';
17
- export { TextField } from './chunk-36HVQ72F.js';
17
+ export { TextField } from './chunk-N2K3QGSX.js';
18
18
  export { ValuePreview } from './chunk-F653O57X.js';
19
19
  export { ValueTable, ValueTableRow } from './chunk-DZJ4GBSP.js';
20
20
  export { SunkenPanel } from './chunk-D5RGM3XA.js';
@@ -23,7 +23,7 @@ export { TabBar } from './chunk-7AK5I7U7.js';
23
23
  export { applySelection, isApplePlatform, selectionGesture } from './chunk-GXSX6Q6O.js';
24
24
  export { Spacer } from './chunk-YMUIQRWK.js';
25
25
  export { SplitButton } from './chunk-TI2GV36S.js';
26
- export { StateBanner } from './chunk-2FW7D4IG.js';
26
+ export { StateBanner } from './chunk-C2ZO3OZZ.js';
27
27
  export { SummaryRow } from './chunk-K67XBCHG.js';
28
28
  export { RadioGroup } from './chunk-OHPYT2BH.js';
29
29
  export { createSearchFieldModel } from './chunk-CIAUILRR.js';
@@ -9,6 +9,15 @@ type StateBannerUrgency = 'status' | 'alert';
9
9
  type StateBannerCopyLayout = 'inline' | 'stacked';
10
10
  type StateBannerActionPlacement = 'trailing' | 'below';
11
11
  type StateBannerPresentation = 'card' | 'strip';
12
+ /** Application `data-*` identity on the banner root; component markers stay protected. */
13
+ type StateBannerRootAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
14
+ 'data-component'?: never;
15
+ 'data-tone'?: never;
16
+ 'data-copy-layout'?: never;
17
+ 'data-action-placement'?: never;
18
+ 'data-presentation'?: never;
19
+ 'data-placeholder'?: never;
20
+ }>;
12
21
  interface StateBannerProps {
13
22
  title: string;
14
23
  detail?: string;
@@ -41,11 +50,13 @@ interface StateBannerProps {
41
50
  */
42
51
  dividerSides?: Sides;
43
52
  className?: string;
53
+ /** Safe `data-*` identity, such as `data-key` for conditional siblings. */
54
+ rootAttributes?: StateBannerRootAttributes;
44
55
  /** Render the title, badge, and detail as unanimated loading skeletons, keeping the icon and tone. The detail line appears only when `detail` is set, as in the live banner. */
45
56
  placeholder?: boolean;
46
57
  /** Native named-slot assignment when composed inside a web component. */
47
58
  slot?: string;
48
59
  }
49
- declare function StateBanner({ title, detail, badge, icon, action, tone, urgency, copyLayout, actionPlacement, presentation, dividerSides, className, placeholder, slot, }: StateBannerProps): SafeHtml;
60
+ declare function StateBanner({ title, detail, badge, icon, action, tone, urgency, copyLayout, actionPlacement, presentation, dividerSides, className, rootAttributes, placeholder, slot, }: StateBannerProps): SafeHtml;
50
61
 
51
- export { SemanticTone, StateBanner, type StateBannerActionPlacement, type StateBannerCopyLayout, type StateBannerPresentation, type StateBannerProps, type StateBannerTone, type StateBannerUrgency };
62
+ export { SemanticTone, StateBanner, type StateBannerActionPlacement, type StateBannerCopyLayout, type StateBannerPresentation, type StateBannerProps, type StateBannerRootAttributes, type StateBannerTone, type StateBannerUrgency };
@@ -1,4 +1,4 @@
1
- export { StateBanner } from './chunk-2FW7D4IG.js';
1
+ export { StateBanner } from './chunk-C2ZO3OZZ.js';
2
2
 
3
3
 
4
4
 
@@ -5,6 +5,8 @@ import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
5
5
  type TextFieldSize = 'default' | 'compact';
6
6
  /** The kinds of single-line value a TextField takes. */
7
7
  type TextFieldType = 'text' | 'email' | 'password' | 'search' | 'url' | 'tel' | 'number' | 'date';
8
+ /** Native virtual-keyboard hint for an input or textarea. */
9
+ type TextFieldInputMode = 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';
8
10
  /** Application `data-*` metadata; the TextField's own markers stay protected. */
9
11
  type TextFieldRootAttributes = Readonly<Record<`data-${string}`, string | undefined>>;
10
12
  /**
@@ -71,6 +73,14 @@ interface TextFieldOptions {
71
73
  /** Request native focus on insertion or when the containing dialog opens. */
72
74
  autofocus?: boolean;
73
75
  autocomplete?: string;
76
+ /** Native capitalization behavior for exact or prose entry. */
77
+ autocapitalize?: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters';
78
+ /** Native autocorrection hint. */
79
+ autocorrect?: 'on' | 'off';
80
+ /** Native virtual-keyboard hint. */
81
+ inputMode?: TextFieldInputMode;
82
+ /** Native spelling check; serialized as the enumerated HTML value. */
83
+ spellcheck?: boolean;
74
84
  /** The input's id, for an external label or form. */
75
85
  id?: string;
76
86
  className?: string;
@@ -86,6 +96,6 @@ interface TextFieldOptions {
86
96
  * The whole field is one `<label>`, so clicking anywhere on it focuses the
87
97
  * input; the input is named by `label` (or `ariaLabel`) directly.
88
98
  */
89
- declare function TextField({ label, ariaLabel, value, name, placeholder, hint, error, size, icon, clearable, clearLabel, maxLength, showCount, type, min, max, step, multiline, rows, maxRows, disabled, readOnly, required, autofocus, autocomplete, id, className, rootAttributes, slot, }: TextFieldProps): kerfjs.SafeHtml;
99
+ declare function TextField({ label, ariaLabel, value, name, placeholder, hint, error, size, icon, clearable, clearLabel, maxLength, showCount, type, min, max, step, multiline, rows, maxRows, disabled, readOnly, required, autofocus, autocomplete, autocapitalize, autocorrect, inputMode, spellcheck, id, className, rootAttributes, slot, }: TextFieldProps): kerfjs.SafeHtml;
90
100
 
91
- export { TextField, type TextFieldName, type TextFieldOptions, type TextFieldProps, type TextFieldRootAttributes, type TextFieldSize, type TextFieldType };
101
+ export { TextField, type TextFieldInputMode, type TextFieldName, type TextFieldOptions, type TextFieldProps, type TextFieldRootAttributes, type TextFieldSize, type TextFieldType };
@@ -1,4 +1,4 @@
1
- export { TextField } from './chunk-36HVQ72F.js';
1
+ export { TextField } from './chunk-N2K3QGSX.js';
2
2
 
3
3
 
4
4
 
@@ -326,6 +326,11 @@ component or helper writes its protected attributes after the accepted metadata.
326
326
  structurally widened, and JavaScript callers therefore cannot replace its
327
327
  contract.
328
328
 
329
+ `StateBanner.rootAttributes` accepts safe `data-*` metadata, including a stable
330
+ `data-key` for conditional sibling banners. Key each sibling so removing an
331
+ earlier status preserves the surviving banner's action node and focus. The
332
+ component's tone, layout, presentation, and placeholder markers stay protected.
333
+
329
334
  `TabBarItem.closeIcon` and `ResizableRegion.handleIcon` replace dormant decorative
330
335
  glyph content only. They must not contain controls or interactive roles. The
331
336
  component continues to own the named close button or focusable separator, and
@@ -2,6 +2,8 @@
2
2
 
3
3
  Start with the [Composer Form recipe](./recipes.md#composer-form). Use one `List` for major section rhythm; give each field its own visible label and nearby hint. A `TextField` owns its label, hint, error, native input, and focus. Use `FieldLabel` for a read-only or click-to-edit field preview, and `ListInsetText` for supporting copy that needs the same text column. Let fields and action rows own their insets instead of wrapping the form in another padded card.
4
4
 
5
+ For exact phrases, names, or numeric strings, configure `TextField` with the native `autocapitalize`, `autocorrect`, `spellcheck`, and `inputMode` props as needed. They reach its input or textarea; `spellcheck={false}` renders `spellcheck="false"` explicitly. `inputMode="numeric"` hints at a numeric keyboard without changing the value to a number or applying number-input validation.
6
+
5
7
  The application owns validation, draft state, permissions, and submission. Validate at the point where the person can act on a problem, keep an invalid field's specific error beside that field, and move focus to the first actionable error after a failed submit. Use a header-area `StateBanner` for a persistent form-level failure or recovery path. A toast suits a short confirmation, not an error that must remain available while the person edits. Never clear a draft or close a popup because unrelated state rerendered.
6
8
 
7
9
  Keep an unavailable choice or action visible and disabled when that helps explain the current state; hide it only when the person has no access to the feature. Put Cancel before the trailing primary or destructive submit action, with space separating them. Use a native form submit button so Enter and browser form behavior work; preserve the draft on transport failure and prevent duplicate submissions while one is in flight. Test live values, `aria-invalid`, focus, and emitted events, not attributes alone.
@@ -14,13 +14,14 @@ Use the spacing scale by relationship: 8px within a group, 16px between like gro
14
14
  - Compose headings with `Toolbar` and direct `ToolbarText`; group related controls with `ToolbarControlGroup`. Keep a control near the surface it affects. A panel's collapse toggle belongs with that panel, and exactly one control owns the action.
15
15
  - A toolbar or dialog header has no decorative divider by default. Use a divider only for a real boundary, such as pinned chrome over scrolling content, with the component's documented API. Do not add persistent instruction copy to explain an ordinary control.
16
16
  - Keep controls mounted when a capability or state temporarily disables them, so neighboring groups do not jump. Disable with a truthful explanation. Hide a control only when the whole capability is absent or the responsive composition deliberately moves it.
17
+ - Remove, rather than disable, a recovery action whose use in the current state would be unsafe or misleading, and let the state's banner say what to do instead; disable only for temporary conditions such as busy or not yet loaded.
17
18
  - Use `SegmentedControl` for a short exclusive view choice, in its own group. Put `SearchField` in the relevant toolbar and make it filter the visible collection. A search control is not a substitute for navigation.
18
19
 
19
20
  ## Actions, feedback, and dialogs
20
21
 
21
22
  - Label a command that opens a dialog with an ellipsis: “Add Ticket…”. The dialog title names the task. For adding an object, use a “+ Thing” toolbar action and a dialog; do not leave an inline creation form in a collection view.
22
23
  - Order dialog actions consistently. Cancel is the leading action, separated from the trailing primary action by a spacer. Negative actions precede positive actions. Mark a destructive action clearly and require confirmation only when undo or recovery cannot safely cover it.
23
- - Use a toast for a transient confirmation. Use `StateBanner` in the affected region's header area for a persistent problem or status that requires attention. Show recovery beside the problem. Do not use a toast as the only record of failure.
24
+ - Use a toast for a transient confirmation. Use `StateBanner` in the affected region's header area for a persistent problem or status that requires attention. Show safe recovery beside the problem; remove an unsafe recovery action as described under Chrome and hierarchy. Do not use a toast as the only record of failure.
24
25
  - Distinguish an empty collection, no search matches, loading, missing setup, offline state, and an error. Never show “no items” while loading. The empty state states what can happen next and offers a relevant action when one exists.
25
26
  - A user action should show its safe local consequence within 100 ms, then reconcile with authoritative data without flicker. Do not block a click on unrelated data. Preserve the pending action and report a rejection where it can be corrected.
26
27
 
package/llms.txt CHANGED
@@ -1030,6 +1030,8 @@ details.
1030
1030
 
1031
1031
  Select menus use native viewport shifting with 10px gutters: default menus grow to content (up to 20rem), while `fitMenu` matches trigger width and long labels wrap. A listbox (like a PopupMenu menu) shifts only along its trigger's edge, never over the trigger: when neither side fits, it opens on the side with more room and scrolls inside its capped height, so a second press on the trigger still closes it. Keep popup sizing and position repairs out of consumer CSS.
1032
1032
 
1033
+ Key conditional `StateBanner` siblings with `rootAttributes={{ "data-key": "…" }}` so removing an earlier banner preserves the surviving action and its focus.
1034
+
1033
1035
  Key sibling `DialogSurface`s that render conditionally with `rootAttributes={{ "data-key": "…" }}` so a re-render morphs each dialog into itself; never wrap one in a keyed app `div`. Modal `DialogSurface` bounds use typed `viewportGutter` and `maxHeight` (`CssLength` or `"viewport"`); explicit caps stay within the dynamic viewport minus both gutters. Omitted props keep the default caps (20px clear of each edge, 80% of the viewport height at 420px wide or narrower). Application render state chooses responsive values, and preview layout remains application-owned. `height` sets a definite bounded modal size and `bodyLayout="fill"` lets one child fill the body; `bodyLayout="fill-last"` keeps leading rows at their height above one filling last child, and `footerPresentation="floating"` (with a typed `footerOffset`) floats a chat composer over the body while the body reserves its measured height; give the transcript `scrollClearance="block-end"` (a `scrollable` `List` or a `Pane`) to let it scroll beneath the composer, with the last message still resting above it, through the published `--kui-scroll-clearance-block-end` context (overlaying chrome publishes `--kui-scroll-clearance-block-start` / `-end`; one scroller per covered edge opts in; a composed Pane opts in through `PaneConfig.scrollClearance` on a Workbench `mainPane` or panel `pane`, a `CollapsiblePanel` `pane`, or a `NavStack` view's `pane`). `headerPresentation="floating"` lays the title bar over the body on the translucent `--kui-chrome-material-raised` (opaque under reduced transparency, increased contrast, and forced colors); the register measures it and the body reserves it, and a `fill` body's only child with `scrollClearance="both"` scrolls beneath both the title bar and a floating composer through the published `--kui-scroll-clearance-block-start`. `presentation="bottom-sheet"` attaches the dialog to the bottom edge with square bottom corners, safe-area and virtual-keyboard clearance behind the panel, and a slide in/out (`enterMotion` / `exitMotion`); `resizable` adds a top grabber separator bounded by `minHeight` and `maxHeight`. `PopoverDialogSurface` is the non-modal, light-dismiss counterpart on the native Popover API, with the same size props and an `embedded` in-flow presentation; `describedBy` sets its `aria-describedby` (usually a title `ToolbarText`'s `descriptionId`).
1034
1036
 
1035
1037
  Render a modal dialog as `DialogSurface` itself, a native `<dialog>` (`alert` renders `role="alertdialog"` for a destructive confirmation; pair it with `describedBy` on the message): `label` (or `labelledBy` with a `heading`, such as an xl `ToolbarText` with a description) names it, `describedBy` (the heading ToolbarText's `descriptionId`, or app-owned summary copy) describes it as `aria-describedby`, `children` is its body, `footer` holds its buttons, and `headerActions` sit before its close button (`withoutHeader` drops the header for content that owns its heading and close control). Open it with `openDialog(dialog)` and close it with `closeDialog(dialog)` from `@kerfjs/ui/surface-scaffold`; never toggle its `open` attribute. The close button, any `data-dialog-close` element inside (a Cancel button), Escape, and, with `lightDismiss`, a backdrop press dispatch a cancelable `kui-request-close` (`detail.source`: `close-button`, `escape`, or `backdrop`); cancel it to keep the dialog open (the panel pulses). The native `close` event fires once it closes. `openDialog` installs the listeners and, while the dialog is open, measures its floating header/footer, follows a bottom sheet's keyboard and grabber, and keeps that state across re-renders; import `@kerfjs/ui/surface-scaffold/register` only when a dialog may open some other way. Do not write `wa-dialog` inside a `DialogSurface`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kerfjs/ui",
3
- "version": "5.0.0-beta.118",
3
+ "version": "5.0.0-beta.119",
4
4
  "description": "Accessible, composable UI primitives for kerf applications.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/feedback/state-banner/state-banner.tsx"],"names":[],"mappings":";;;;;AAuDO,SAAS,WAAA,CAAY;AAAA,EAC1B,KAAA;AAAA,EACA,MAAA;AAAA,EACA,KAAA;AAAA,EACA,IAAA;AAAA,EACA,MAAA;AAAA,EACA,IAAA,GAAO,MAAA;AAAA,EACP,OAAA,GAAU,QAAA;AAAA,EACV,UAAA,GAAa,QAAA;AAAA,EACb,eAAA,GAAkB,UAAA;AAAA,EAClB,YAAA,GAAe,MAAA;AAAA,EACf,YAAA,GAAe,GAAA;AAAA,EACf,SAAA,GAAY,EAAA;AAAA,EACZ,WAAA,GAAc,KAAA;AAAA,EACd;AACF,CAAA,EAAqB;AACnB,EAAA,uBACE,IAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO,CAAA,iBAAA,EAAoB,SAAS,CAAA,CAAA,CAAG,IAAA,EAAK;AAAA,MAC5C,gBAAA,EAAe,cAAA;AAAA,MACf,WAAA,EAAW,IAAA;AAAA,MACX,kBAAA,EAAkB,UAAA;AAAA,MAClB,uBA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4BAA4B,QAAA,EAAA,MAAA,EAAO;AAAA;AAAA;AAAA,GAC3D;AAEJ","file":"chunk-2FW7D4IG.js","sourcesContent":["import type { SafeHtml } from 'kerfjs';\n\nimport type { KerfUiContent } from '../../../shared/content/semantic-content.js';\nimport type { Sides } from '../../../shared/layout/sides.js';\nimport { em } from '../../../shared/styles/css-values.js';\nimport type { SemanticTone } from '../../../shared/styles/semantic-tone.js';\nimport { Badge } from '../badge/badge.js';\nimport { Skeleton } from '../skeleton/skeleton.js';\n\nexport type { SemanticTone } from '../../../shared/styles/semantic-tone.js';\n/** @deprecated Use SemanticTone. */\nexport type StateBannerTone = SemanticTone;\nexport type StateBannerUrgency = 'status' | 'alert';\nexport type StateBannerCopyLayout = 'inline' | 'stacked';\nexport type StateBannerActionPlacement = 'trailing' | 'below';\nexport type StateBannerPresentation = 'card' | 'strip';\n\nexport interface StateBannerProps {\n title: string;\n detail?: string;\n /** Optional compact status or count shown beside the title. */\n badge?: string;\n icon?: SafeHtml;\n action?: KerfUiContent;\n tone?: SemanticTone;\n urgency?: StateBannerUrgency;\n /** Keep the detail beside the title, or give it its own line. */\n copyLayout?: StateBannerCopyLayout;\n /**\n * `trailing` (the default) puts the action beside the copy while the copy\n * keeps its minimum readable width, and otherwise wraps it onto its own\n * end-aligned trailing row, at any viewport or container width. `below`\n * always gives the action that separate trailing row.\n */\n actionPlacement?: StateBannerActionPlacement;\n /**\n * `card` (the default) is an inset, rounded, fully bordered banner beside\n * the affected work. `strip` is a full-width band at a layout edge, such as\n * above a workspace: square corners, no inline margin, inline padding on the\n * shared content-text column, and only the tone-colored `dividerSides` edges.\n */\n presentation?: StateBannerPresentation;\n /**\n * Physical tone-colored divider edges of a `strip`, in canonical\n * top/right/bottom/left order. Defaults to the bottom edge; `''` draws none.\n * A `card` keeps its full border and ignores this.\n */\n dividerSides?: Sides;\n className?: string;\n /** Render the title, badge, and detail as unanimated loading skeletons, keeping the icon and tone. The detail line appears only when `detail` is set, as in the live banner. */\n placeholder?: boolean;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n}\n\nexport function StateBanner({\n title,\n detail,\n badge,\n icon,\n action,\n tone = 'info',\n urgency = 'status',\n copyLayout = 'inline',\n actionPlacement = 'trailing',\n presentation = 'card',\n dividerSides = 'b',\n className = '',\n placeholder = false,\n slot,\n}: StateBannerProps) {\n return (\n <section\n class={`kui-state-banner ${className}`.trim()}\n data-component=\"state-banner\"\n data-tone={tone}\n data-copy-layout={copyLayout}\n data-action-placement={actionPlacement}\n data-presentation={presentation}\n divider-sides={\n presentation === 'strip' ? dividerSides || undefined : undefined\n }\n data-placeholder={placeholder ? 'true' : undefined}\n role={urgency}\n aria-live={urgency === 'alert' ? 'assertive' : 'polite'}\n aria-busy={placeholder ? 'true' : undefined}\n slot={slot}\n >\n {icon && <span class=\"kui-state-banner__icon\">{icon}</span>}\n <div class=\"kui-state-banner__copy\">\n <strong>{placeholder ? <Skeleton width={em(10)} /> : title}</strong>\n {badge && (\n <Badge appearance=\"solid\" size=\"compact\" tone={tone}>\n {placeholder ? <Skeleton width={em(1.75)} /> : badge}\n </Badge>\n )}\n {detail && (\n <span class=\"kui-state-banner__detail\">\n <span>{placeholder ? <Skeleton width={em(16)} /> : detail}</span>\n </span>\n )}\n </div>\n {action && <div class=\"kui-state-banner__action\">{action}</div>}\n </section>\n );\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/forms/text-field/text-field.tsx"],"names":[],"mappings":";;;;;AAaA,IAAM,oBAAA,uBAA2B,GAAA,CAAI;AAAA,EACnC,gBAAA;AAAA,EACA,WAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF,CAAC,CAAA;AAoFM,SAAS,SAAA,CAAU;AAAA,EACxB,KAAA;AAAA,EACA,SAAA;AAAA,EACA,KAAA;AAAA,EACA,IAAA;AAAA,EACA,WAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,IAAA,GAAO,SAAA;AAAA,EACP,IAAA;AAA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AAAA,8BACA,MAAA,EAAA,EAAK,KAAA,EAAM,uBAAA,EAAwB,uBAAA,EAAsB,IACvD,QAAA,EAAA,KAAA,EACH;AAAA,SAAA,EACF,CAAA;AAAA,QAED,KAAA,KAAU,SAAY,IAAA,mBACrB,GAAA,CAAC,UAAK,KAAA,EAAM,uBAAA,EAAwB,aAAA,EAAY,MAAA,EAC7C,QAAA,EAAA,KAAA,EACH;AAAA;AAAA;AAAA,GAEJ;AAEJ","file":"chunk-36HVQ72F.js","sourcesContent":["import { CircleX } from 'lucide';\n\nimport type { KerfUiContent } from '../../../shared/content/semantic-content.js';\nimport { filterDataAttributes } from '../../../shared/dom/extension-attributes.js';\nimport { LucideIcon } from '../../media/lucide-icon/lucide-icon.js';\n\n/** `default` is the 44px control height; `compact` is 33px with smaller text. */\nexport type TextFieldSize = 'default' | 'compact';\n\n/** The kinds of single-line value a TextField takes. */\nexport type TextFieldType =\n 'text' | 'email' | 'password' | 'search' | 'url' | 'tel' | 'number' | 'date';\n\nconst TEXT_FIELD_PROTECTED = new Set([\n 'data-component',\n 'data-size',\n 'data-invalid',\n 'data-multiline',\n]);\n\n/** Application `data-*` metadata; the TextField's own markers stay protected. */\nexport type TextFieldRootAttributes = Readonly<\n Record<`data-${string}`, string | undefined>\n>;\n\n/**\n * The field's accessible name: a visible `label`, or `ariaLabel` when the\n * surrounding content already names it.\n */\nexport type TextFieldName =\n { label: string; ariaLabel?: never } | { label?: never; ariaLabel: string };\n\nexport type TextFieldProps = TextFieldName & TextFieldOptions;\n\nexport interface TextFieldOptions {\n /** The controlled value. */\n value?: string;\n name?: string;\n placeholder?: string;\n /** Supporting text below the field, also its accessible description. */\n hint?: string;\n /**\n * A validation message: shown below the field in the danger color, added\n * to its description, and marking it `aria-invalid`.\n */\n error?: string;\n size?: TextFieldSize;\n /** A leading decorative icon, such as a `LucideIcon` (single-line only). */\n icon?: KerfUiContent;\n /**\n * A clear button while the field has a value (single-line only). Needs\n * `wireTextFields(root)`, which clears the field and announces `input`.\n */\n clearable?: boolean;\n /** The clear button's accessible name (default `Clear`). */\n clearLabel?: string;\n /** The most characters the field accepts (native `maxlength`). */\n maxLength?: number;\n /**\n * Show a live `count / maxLength` below the field. Needs `maxLength` and\n * `wireTextFields(root)`, which updates it as people type.\n */\n showCount?: boolean;\n /** Single-line value kind (default `text`); `date` uses the native picker. */\n type?: TextFieldType;\n /** Native lower bound for `type=\"number\"` (number or numeric string). */\n min?: number | string;\n /** Native upper bound for `type=\"number\"` (number or numeric string). */\n max?: number | string;\n /** Native number increment (number, numeric string, or `\"any\"`). */\n step?: number | string;\n /** A multi-line field: a `<textarea>`. */\n multiline?: boolean;\n /** A multi-line field's height in lines (default 3). */\n rows?: number;\n /**\n * Grow a multi-line field with its content from `rows` up to this many\n * lines, then scroll.\n */\n maxRows?: number;\n disabled?: boolean;\n readOnly?: boolean;\n required?: boolean;\n /** Request native focus on insertion or when the containing dialog opens. */\n autofocus?: boolean;\n autocomplete?: string;\n /** The input's id, for an external label or form. */\n id?: string;\n className?: string;\n /** Safe `data-*` metadata (a `data-key`). */\n rootAttributes?: TextFieldRootAttributes;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n}\n\n/**\n * A text input with its label above, an optional leading icon and clear\n * button, and supporting or error text below, at the 44px control height or\n * compact. `multiline` makes it a textarea that can grow with its content.\n * The whole field is one `<label>`, so clicking anywhere on it focuses the\n * input; the input is named by `label` (or `ariaLabel`) directly.\n */\nexport function TextField({\n label,\n ariaLabel,\n value,\n name,\n placeholder,\n hint,\n error,\n size = 'default',\n icon,\n clearable = false,\n clearLabel = 'Clear',\n maxLength,\n showCount = false,\n type = 'text',\n min,\n max,\n step,\n multiline = false,\n rows = 3,\n maxRows,\n disabled = false,\n readOnly = false,\n required = false,\n autofocus = false,\n autocomplete,\n id,\n className = '',\n rootAttributes = {},\n slot,\n}: TextFieldProps) {\n const description = [hint, error].filter(Boolean).join(' ') || undefined;\n const shared = {\n id,\n name,\n // A clearable field always has a placeholder, so CSS can hide its clear\n // button while the field is empty (`:placeholder-shown`); a blank one\n // shows nothing.\n placeholder: clearable && !multiline ? (placeholder ?? ' ') : placeholder,\n disabled,\n readonly: readOnly,\n required,\n autofocus,\n autocomplete,\n maxlength: maxLength,\n // The label element also wraps the clear button and the count, so the\n // input takes its name explicitly rather than from the label's text.\n 'aria-label': label ?? ariaLabel,\n 'aria-description': description,\n 'aria-invalid': error ? 'true' : undefined,\n } as const;\n const hintText =\n hint === undefined ? null : (\n <span class=\"kui-text-field__hint\" aria-hidden=\"true\">\n {hint}\n </span>\n );\n const count =\n showCount && maxLength !== undefined\n ? `${String((value ?? '').length)} / ${String(maxLength)}`\n : undefined;\n const style = [\n multiline ? `--_kui-text-field-rows:${String(rows)}` : '',\n multiline && maxRows !== undefined\n ? `--_kui-text-field-max-rows:${String(Math.max(rows, maxRows))}`\n : '',\n ]\n .filter(Boolean)\n .join(';');\n return (\n <label\n {...filterDataAttributes(rootAttributes, TEXT_FIELD_PROTECTED)}\n class={`kui-text-field ${className}`.trim()}\n data-component=\"text-field\"\n data-size={size}\n data-invalid={error ? '' : undefined}\n data-multiline={\n multiline ? (maxRows === undefined ? '' : 'grow') : undefined\n }\n style={style || undefined}\n slot={slot}\n >\n {label === undefined ? null : (\n <span class=\"kui-text-field__label\" aria-hidden=\"true\">\n {label}\n {required ? (\n <span class=\"kui-text-field__required\" aria-hidden=\"true\">\n *\n </span>\n ) : null}\n </span>\n )}\n <span class=\"kui-text-field__box\">\n {icon === undefined || multiline ? null : (\n <span class=\"kui-text-field__icon\" aria-hidden=\"true\">\n {icon}\n </span>\n )}\n {multiline ? (\n <textarea {...shared} class=\"kui-text-field__input\" rows={rows}>\n {value ?? ''}\n </textarea>\n ) : (\n <input\n {...shared}\n class=\"kui-text-field__input\"\n type={type}\n value={value}\n min={type === 'number' ? min : undefined}\n max={type === 'number' ? max : undefined}\n step={type === 'number' ? step : undefined}\n />\n )}\n {clearable && !multiline ? (\n <button\n type=\"button\"\n class=\"kui-text-field__clear\"\n aria-label={clearLabel}\n data-text-field-clear=\"\"\n disabled={disabled || readOnly}\n >\n <LucideIcon icon={CircleX} name=\"circle-x\" />\n </button>\n ) : null}\n </span>\n {count === undefined ? (\n hintText\n ) : (\n <span class=\"kui-text-field__footer\">\n {hintText}\n <span class=\"kui-text-field__count\" data-text-field-count=\"\">\n {count}\n </span>\n </span>\n )}\n {error === undefined ? null : (\n <span class=\"kui-text-field__error\" aria-hidden=\"true\">\n {error}\n </span>\n )}\n </label>\n );\n}\n"]}