@f-ewald/components 1.1.1 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +4 -0
  2. package/custom-elements.json +2336 -290
  3. package/dist/form-select.d.ts +5 -4
  4. package/dist/form-select.d.ts.map +1 -1
  5. package/dist/form-select.js +6 -5
  6. package/dist/form-select.js.map +1 -1
  7. package/dist/icons.d.ts +1 -0
  8. package/dist/icons.d.ts.map +1 -1
  9. package/dist/icons.js +1 -0
  10. package/dist/icons.js.map +1 -1
  11. package/dist/index.d.ts +4 -0
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +4 -0
  14. package/dist/index.js.map +1 -1
  15. package/dist/kanban-board.d.ts +110 -0
  16. package/dist/kanban-board.d.ts.map +1 -0
  17. package/dist/kanban-board.js +619 -0
  18. package/dist/kanban-board.js.map +1 -0
  19. package/dist/kanban-card.d.ts +35 -0
  20. package/dist/kanban-card.d.ts.map +1 -0
  21. package/dist/kanban-card.js +163 -0
  22. package/dist/kanban-card.js.map +1 -0
  23. package/dist/kanban-column.d.ts +30 -0
  24. package/dist/kanban-column.d.ts.map +1 -0
  25. package/dist/kanban-column.js +166 -0
  26. package/dist/kanban-column.js.map +1 -0
  27. package/dist/multi-select.d.ts +142 -0
  28. package/dist/multi-select.d.ts.map +1 -0
  29. package/dist/multi-select.js +1304 -0
  30. package/dist/multi-select.js.map +1 -0
  31. package/dist/popover-panel.js +1 -1
  32. package/dist/popover-panel.js.map +1 -1
  33. package/dist/tokens.css +3 -0
  34. package/dist/tokens.d.ts.map +1 -1
  35. package/dist/tokens.js +2 -0
  36. package/dist/tokens.js.map +1 -1
  37. package/docs/design-language.md +8 -0
  38. package/docs/form-select.md +5 -4
  39. package/docs/kanban-board.md +96 -0
  40. package/docs/kanban-card.md +56 -0
  41. package/docs/kanban-column.md +58 -0
  42. package/docs/multi-select.md +120 -0
  43. package/llms.txt +182 -4
  44. package/package.json +1 -1
@@ -0,0 +1,142 @@
1
+ import { LitElement, type PropertyValues, type TemplateResult } from "lit";
2
+ /**
3
+ * Presentation variant of {@link MultiSelect}.
4
+ *
5
+ * - `"dropdown"` (default): a compact trigger that opens a listbox popover.
6
+ * - `"list"`: a persistently visible, bordered list surface with no popover.
7
+ */
8
+ export type MultiSelectVariant = "dropdown" | "list";
9
+ /** A single selectable option. */
10
+ export interface MultiSelectOption {
11
+ value: string;
12
+ label: string;
13
+ /** Optional pre-rendered icon template displayed before the label. */
14
+ icon?: TemplateResult;
15
+ /** Square icon size in pixels. Defaults to 16 when `icon` is set. */
16
+ iconSize?: number;
17
+ /** When true, the option can neither be selected nor removed via the UI. */
18
+ disabled?: boolean;
19
+ }
20
+ /**
21
+ * A form-associated multi-select: a trigger showing a compact summary of the
22
+ * current selection, opening a multi-selectable listbox popover, with an
23
+ * optional removable-chip list of the chosen values. A drop-in generic
24
+ * replacement for a native `<select multiple>` — set `name` on the element
25
+ * itself and each
26
+ * selected value is submitted as a repeated `name=value` entry, matching native
27
+ * multiple-select semantics; `new FormData(form).getAll(name)` and
28
+ * `form.reset()` work unchanged.
29
+ *
30
+ * The trigger visually follows `form-select`: a `2rem` field showing the
31
+ * `placeholder` when empty, the single selected label when one value is chosen,
32
+ * and `N selected` when several are. Set `show-chips` to additionally render
33
+ * the selected values as compact chips below the trigger, each with an
34
+ * accessible `32px` remove control; chips are off by default and the region
35
+ * reserves no space while nothing is selected. Like `form-select`, the host is
36
+ * `display: block` and fills its container by default; constrain the host
37
+ * (`multi-select { display: inline-block; }`) to shrink it to its content
38
+ * instead.
39
+ *
40
+ * Set `searchable` to replace the button trigger with an editable combobox that
41
+ * infix-filters the predefined options by case-insensitive label. Typed text is
42
+ * only a query: `values` changes exclusively when options are toggled, and an
43
+ * uncommitted query is discarded when the list closes.
44
+ *
45
+ * The `variant` chooses between two presentations, and `searchable` applies to
46
+ * both:
47
+ *
48
+ * - `"dropdown"` (default) is the popover form described above: a compact
49
+ * trigger (button, or search combobox when `searchable`) that opens a
50
+ * multi-selectable listbox on demand, closes on outside click / Escape, and
51
+ * shows a chevron.
52
+ * - `"list"` renders the options as a persistently visible, bordered surface
53
+ * with no popover, no chevron, and no `open` host state; it never registers
54
+ * outside-click listeners. Its scroll viewport is sized to roughly
55
+ * `visibleRows` `2rem` rows (see `visible-rows`). When not `searchable` the
56
+ * `listbox` itself is focusable and drives Arrow/Home/End/Enter/Space keyboard
57
+ * navigation via `aria-activedescendant`; when `searchable` a `2rem` search
58
+ * field sits above the list and owns navigation, and Escape only clears the
59
+ * query instead of hiding the list.
60
+ *
61
+ * @element multi-select
62
+ * @fires change - Fired with `{ values: string[] }` (a copied array) when a
63
+ * value is added or removed through the UI. Programmatic `values` assignments
64
+ * do not fire it.
65
+ */
66
+ export declare class MultiSelect extends LitElement {
67
+ #private;
68
+ static formAssociated: boolean;
69
+ static styles: import("lit").CSSResult[];
70
+ /** The full list of selectable options. */
71
+ options: MultiSelectOption[];
72
+ /**
73
+ * The currently selected values. Programmatic assignments are deduplicated
74
+ * while preserving order and never fire `change`.
75
+ */
76
+ values: string[];
77
+ /** Form control name; each selected value submits under it. */
78
+ name: string;
79
+ /** Accessible label applied to the trigger. */
80
+ label: string;
81
+ /** Text shown on the trigger when nothing is selected. */
82
+ placeholder: string;
83
+ /** Disables the whole control, preventing the popover from opening. */
84
+ disabled: boolean;
85
+ /** Marks the control as required for native form validation. */
86
+ required: boolean;
87
+ /**
88
+ * Enables editable, case-insensitive infix filtering by option label.
89
+ * Typed text never becomes a selected value.
90
+ */
91
+ searchable: boolean;
92
+ /** Maximum number of selectable values; `0` (default) means unlimited. */
93
+ max: number;
94
+ /**
95
+ * Presentation variant. `"dropdown"` (default) opens a popover listbox;
96
+ * `"list"` renders a persistently visible, bordered list surface. Reflected
97
+ * so consumers can style by `[variant="list"]`.
98
+ */
99
+ variant: MultiSelectVariant;
100
+ /**
101
+ * Number of `2rem` rows the `list` variant's scroll viewport shows before it
102
+ * scrolls, mirroring a native `<select size>`. Normalized to an integer of at
103
+ * least `1` (default `5`); ignored by the `dropdown` variant.
104
+ */
105
+ visibleRows: number;
106
+ /**
107
+ * When true, the selected values are also rendered as removable chips below
108
+ * the trigger, each with an accessible `32px` remove control. Off by default:
109
+ * the trigger already summarizes the selection, and values can be toggled off
110
+ * in the listbox. Applies to both variants.
111
+ */
112
+ showChips: boolean;
113
+ private _open;
114
+ private _activeIndex;
115
+ private _query;
116
+ private _formDisabled;
117
+ disconnectedCallback(): void;
118
+ protected willUpdate(changed: PropertyValues): void;
119
+ protected updated(changed: PropertyValues): void;
120
+ /** Restores the selection captured at first render, per the form contract. */
121
+ formResetCallback(): void;
122
+ /** Mirrors an ancestor fieldset's disabled state and closes the popover. */
123
+ formDisabledCallback(disabled: boolean): void;
124
+ /** Restores the selection from the saved form state on navigation/autofill. */
125
+ formStateRestoreCallback(state: string | File | FormData | null): void;
126
+ /** The shared `<li role="option">` items for both variants' listboxes. */
127
+ private renderOptionItems;
128
+ private renderListbox;
129
+ private renderChips;
130
+ private renderSearchTrigger;
131
+ private renderButtonTrigger;
132
+ private renderListSearch;
133
+ private renderPersistentList;
134
+ private renderListVariant;
135
+ render(): TemplateResult<1>;
136
+ }
137
+ declare global {
138
+ interface HTMLElementTagNameMap {
139
+ "multi-select": MultiSelect;
140
+ }
141
+ }
142
+ //# sourceMappingURL=multi-select.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multi-select.d.ts","sourceRoot":"","sources":["../src/multi-select.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAIV,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,KAAK,CAAC;AAOb;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,MAAM,CAAC;AAErD,kCAAkC;AAClC,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,IAAI,C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