@leonardaustin/ui 0.14.0 → 0.16.0

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 (35) hide show
  1. package/dist/components/app-shell/MobileDrawer.d.ts.map +1 -1
  2. package/dist/components/app-shell/Sidebar.d.ts.map +1 -1
  3. package/dist/components/app-shell/ThemeMenu.d.ts.map +1 -1
  4. package/dist/components/ui/Combobox.d.ts.map +1 -1
  5. package/dist/components/ui/Dialog.d.ts.map +1 -1
  6. package/dist/components/ui/DropdownMenu.d.ts +3 -1
  7. package/dist/components/ui/DropdownMenu.d.ts.map +1 -1
  8. package/dist/components/ui/FieldContext.d.ts +2 -0
  9. package/dist/components/ui/FieldContext.d.ts.map +1 -1
  10. package/dist/components/ui/FormField.d.ts +9 -1
  11. package/dist/components/ui/FormField.d.ts.map +1 -1
  12. package/dist/components/ui/Select.d.ts +4 -1
  13. package/dist/components/ui/Select.d.ts.map +1 -1
  14. package/dist/components/ui/SelectDropdown.d.ts +10 -3
  15. package/dist/components/ui/SelectDropdown.d.ts.map +1 -1
  16. package/dist/components/ui/SideSheet.d.ts.map +1 -1
  17. package/dist/components/ui/Tooltip.d.ts +11 -4
  18. package/dist/components/ui/Tooltip.d.ts.map +1 -1
  19. package/dist/components/ui/calendar/MonthView.d.ts.map +1 -1
  20. package/dist/components/ui/useFieldControl.d.ts +1 -0
  21. package/dist/components/ui/useFieldControl.d.ts.map +1 -1
  22. package/dist/hooks/useAnchoredPopup.d.ts +17 -0
  23. package/dist/hooks/useAnchoredPopup.d.ts.map +1 -1
  24. package/dist/hooks/useDismiss.d.ts.map +1 -1
  25. package/dist/hooks/usePortalContainer.d.ts +30 -0
  26. package/dist/hooks/usePortalContainer.d.ts.map +1 -0
  27. package/dist/hooks/useTypeahead.d.ts +11 -0
  28. package/dist/hooks/useTypeahead.d.ts.map +1 -0
  29. package/dist/index.d.ts +1 -0
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +1867 -1601
  32. package/dist/lib/typeahead.d.ts +35 -0
  33. package/dist/lib/typeahead.d.ts.map +1 -0
  34. package/dist/styles.css +17 -0
  35. package/package.json +1 -1
@@ -0,0 +1,35 @@
1
+ /** How long (ms) a pause ends a typeahead search and starts a new one. */
2
+ export declare const TYPEAHEAD_RESET_MS = 500;
3
+ /** The text typed so far and when the last character arrived. */
4
+ export interface TypeaheadState {
5
+ text: string;
6
+ at: number;
7
+ }
8
+ export declare const EMPTY_TYPEAHEAD: TypeaheadState;
9
+ /** Current time for typeahead; kept out of components so render stays pure. */
10
+ export declare function typeaheadNow(): number;
11
+ /** True for a key that adds to a search: one printable character, no shortcut modifier. */
12
+ export declare function isTypeaheadKey(event: {
13
+ key: string;
14
+ ctrlKey: boolean;
15
+ metaKey: boolean;
16
+ altKey: boolean;
17
+ getModifierState?: (key: "AltGraph") => boolean;
18
+ }): boolean;
19
+ /** Whether a search is in progress at `at` (non-empty and not timed out). */
20
+ export declare function isTypeaheadActive(state: TypeaheadState, at: number): boolean;
21
+ /** The state after typing `char` at `at`; a stale search starts over. */
22
+ export declare function appendTypeahead(state: TypeaheadState, char: string, at: number): TypeaheadState;
23
+ /**
24
+ * The index of the item a search lands on, or -1 for none. Matching is a
25
+ * case-insensitive prefix test on the trimmed label, and disabled items are
26
+ * skipped.
27
+ *
28
+ * A single character, or the same character typed repeatedly, searches
29
+ * forward from the item after `current` and wraps, so repeating a letter
30
+ * cycles through the items that start with it. A longer search starts at
31
+ * `current` itself, so refining it keeps the current item when it still
32
+ * matches.
33
+ */
34
+ export declare function findTypeaheadMatch(labels: readonly string[], isDisabled: (index: number) => boolean, current: number, query: string): number;
35
+ //# sourceMappingURL=typeahead.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeahead.d.ts","sourceRoot":"","sources":["../../src/lib/typeahead.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAEtC,iEAAiE;AACjE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,eAAO,MAAM,eAAe,EAAE,cAAoC,CAAC;AAEnE,+EAA+E;AAC/E,wBAAgB,YAAY,WAE3B;AAED,2FAA2F;AAC3F,wBAAgB,cAAc,CAAC,KAAK,EAAE;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,UAAU,KAAK,OAAO,CAAC;CACjD,WAOA;AAED,6EAA6E;AAC7E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,WAElE;AAED,yEAAyE;AACzE,wBAAgB,eAAe,CAC7B,KAAK,EAAE,cAAc,EACrB,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,GACT,cAAc,CAGhB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,EACtC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GACZ,MAAM,CAiBR"}
package/dist/styles.css CHANGED
@@ -2048,6 +2048,23 @@ button.ui-sized-control[data-control-size="comfortable"] {
2048
2048
  select.ui-sized-control[data-control-size="comfortable"] {
2049
2049
  padding-inline-end: 2.25rem;
2050
2050
  }
2051
+ .ui-select-placeholder {
2052
+ left: calc(var(--spacing) * 2);
2053
+ right: calc(var(--spacing) * 7);
2054
+ font-size: 0.75rem;
2055
+ }
2056
+ [data-control-size="compact"] > .ui-select-placeholder {
2057
+ left: var(--ui-control-padding-x, calc(var(--spacing) * 2));
2058
+ font-size: var(--ui-control-font-size, 0.75rem);
2059
+ }
2060
+ [data-control-size="comfortable"] > .ui-select-placeholder {
2061
+ left: 0.75rem;
2062
+ right: 2.25rem;
2063
+ font-size: 1rem;
2064
+ }
2065
+ select:disabled + .ui-select-placeholder {
2066
+ opacity: 0.4;
2067
+ }
2051
2068
  .ui-password-input[data-control-size="comfortable"] {
2052
2069
  padding-inline-end: 44px;
2053
2070
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leonardaustin/ui",
3
- "version": "0.14.0",
3
+ "version": "0.16.0",
4
4
  "description": "Reusable React component library and application shell for Leonard Austin projects.",
5
5
  "license": "MIT",
6
6
  "type": "module",