@flikk/ui 1.0.0-beta.32 โ†’ 1.0.0-beta.33

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 (54) hide show
  1. package/CHANGELOG.md +202 -0
  2. package/dist/components/ai/AgentRequest/AgentRequest.theme.js +1 -1
  3. package/dist/components/core/Button/Button.theme.js +3 -3
  4. package/dist/components/core/Pill/Pill.js +32 -17
  5. package/dist/components/core/Pill/Pill.types.d.ts +14 -1
  6. package/dist/components/core/SlidingNumber/SlidingNumber.d.ts +8 -0
  7. package/dist/components/core/SlidingNumber/SlidingNumber.js +12 -3
  8. package/dist/components/forms/ColorPicker/ColorPicker.js +45 -3
  9. package/dist/components/forms/ColorPicker/ColorPickerBody.js +8 -4
  10. package/dist/components/forms/Combobox/Combobox.js +8 -4
  11. package/dist/components/forms/Combobox/Combobox.theme.js +9 -0
  12. package/dist/components/forms/Combobox/Combobox.types.d.ts +13 -0
  13. package/dist/components/forms/DatePicker/DatePicker.js +19 -12
  14. package/dist/components/forms/DatePicker/DatePicker.theme.js +5 -0
  15. package/dist/components/forms/DatePicker/DatePicker.types.d.ts +8 -0
  16. package/dist/components/forms/DatePicker/DatePickerContext.d.ts +0 -1
  17. package/dist/components/forms/DatePicker/DatePickerTrigger.js +5 -3
  18. package/dist/components/forms/DateRangePicker/DateRangePicker.theme.js +5 -0
  19. package/dist/components/forms/DateRangePicker/DateRangePicker.types.d.ts +8 -0
  20. package/dist/components/forms/DateRangePicker/DateRangePickerTrigger.js +5 -3
  21. package/dist/components/forms/Input/Input.js +17 -12
  22. package/dist/components/forms/Input/Input.theme.js +10 -0
  23. package/dist/components/forms/Input/Input.types.d.ts +14 -0
  24. package/dist/components/forms/InputAddress/InputAddress.js +5 -5
  25. package/dist/components/forms/InputAddress/InputAddress.types.d.ts +7 -0
  26. package/dist/components/forms/InputCounter/InputCounter.js +194 -17
  27. package/dist/components/forms/InputCounter/InputCounter.theme.d.ts +12 -0
  28. package/dist/components/forms/InputCounter/InputCounter.theme.js +92 -2
  29. package/dist/components/forms/InputCounter/InputCounter.types.d.ts +47 -4
  30. package/dist/components/forms/InputCreditCard/InputCreditCard.js +4 -4
  31. package/dist/components/forms/InputCreditCard/InputCreditCard.types.d.ts +7 -0
  32. package/dist/components/forms/Mention/Mention.js +13 -11
  33. package/dist/components/forms/RichTextEditor/RichTextEditor.js +12 -3
  34. package/dist/components/forms/Select/Select.js +15 -8
  35. package/dist/components/forms/Select/Select.theme.js +9 -1
  36. package/dist/components/forms/Select/Select.types.d.ts +16 -1
  37. package/dist/components/forms/Textarea/Textarea.js +14 -25
  38. package/dist/components/forms/TimePicker/TimePicker.theme.js +9 -0
  39. package/dist/components/forms/TimePicker/TimePicker.types.d.ts +11 -0
  40. package/dist/components/forms/TimePicker/TimePickerTrigger.js +7 -5
  41. package/dist/components/forms/forms.theme.d.ts +57 -0
  42. package/dist/components/forms/forms.theme.js +83 -8
  43. package/dist/components/generative/registry.js +1 -0
  44. package/dist/components/generative/schema.generated.js +21 -1
  45. package/dist/generative.schema.json +21 -1
  46. package/dist/registry.json +108 -17
  47. package/dist/styles.css +1 -1
  48. package/dist/tools.json +21 -1
  49. package/dist/utils/composeEventHandlers.d.ts +19 -0
  50. package/dist/utils/composeEventHandlers.js +26 -0
  51. package/dist/utils/composeEventHandlers.test.d.ts +1 -0
  52. package/dist/utils/index.d.ts +1 -0
  53. package/package.json +1 -1
  54. package/src/styles/theme.css +33 -9
package/dist/tools.json CHANGED
@@ -1881,6 +1881,21 @@
1881
1881
  "required": true,
1882
1882
  "description": "Current counter value (controlled)"
1883
1883
  },
1884
+ "size": {
1885
+ "kind": "enum",
1886
+ "options": [
1887
+ "sm",
1888
+ "md",
1889
+ "lg"
1890
+ ],
1891
+ "default": "md",
1892
+ "description": "Control size, drawn from the shared `--form-*` scale so a counter lines up"
1893
+ },
1894
+ "editable": {
1895
+ "kind": "boolean",
1896
+ "default": true,
1897
+ "description": "Whether clicking the number swaps it for a text field so the value can be"
1898
+ },
1884
1899
  "state": {
1885
1900
  "kind": "enum",
1886
1901
  "options": [
@@ -2667,7 +2682,12 @@
2667
2682
  },
2668
2683
  "selected": {
2669
2684
  "kind": "boolean",
2670
- "description": "Whether the pill is selected (controlled state)"
2685
+ "description": "Whether the pill is selected โ€” CONTROLLED. Passing it makes the prop"
2686
+ },
2687
+ "defaultSelected": {
2688
+ "kind": "boolean",
2689
+ "default": false,
2690
+ "description": "Initial selection for an UNCONTROLLED pill, which then owns its own state."
2671
2691
  },
2672
2692
  "readOnly": {
2673
2693
  "kind": "boolean",
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Compose a component's own event handler with the consumer's.
3
+ *
4
+ * ๐Ÿ”ด ยง9: a prop the component also sets is MERGED, never clobbered. Spreading
5
+ * `{...rest}` before the element's own `onKeyUp` drops the consumer's handler
6
+ * silently; spreading it after lets the consumer silently replace load-bearing
7
+ * internal machinery. Composition is the only option that serves both.
8
+ *
9
+ * **Ours runs first**, so consumer code observes settled internal state.
10
+ *
11
+ * ๐Ÿ”ด **Both handlers ALWAYS run.** A `preventDefault()` in either does NOT skip
12
+ * the other โ€” a consumer that cares reads `event.defaultPrevented`. Dropping the
13
+ * second handler conditionally would reintroduce the invisible-drop bug this
14
+ * helper exists to remove.
15
+ *
16
+ * @example
17
+ * <div onKeyUp={composeEventHandlers(syncFormatting, onKeyUpProp)} />
18
+ */
19
+ export declare function composeEventHandlers<E>(ours: ((event: E) => void) | undefined, theirs: ((event: E) => void) | undefined): (event: E) => void;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Compose a component's own event handler with the consumer's.
3
+ *
4
+ * ๐Ÿ”ด ยง9: a prop the component also sets is MERGED, never clobbered. Spreading
5
+ * `{...rest}` before the element's own `onKeyUp` drops the consumer's handler
6
+ * silently; spreading it after lets the consumer silently replace load-bearing
7
+ * internal machinery. Composition is the only option that serves both.
8
+ *
9
+ * **Ours runs first**, so consumer code observes settled internal state.
10
+ *
11
+ * ๐Ÿ”ด **Both handlers ALWAYS run.** A `preventDefault()` in either does NOT skip
12
+ * the other โ€” a consumer that cares reads `event.defaultPrevented`. Dropping the
13
+ * second handler conditionally would reintroduce the invisible-drop bug this
14
+ * helper exists to remove.
15
+ *
16
+ * @example
17
+ * <div onKeyUp={composeEventHandlers(syncFormatting, onKeyUpProp)} />
18
+ */
19
+ function composeEventHandlers(ours, theirs) {
20
+ return (event) => {
21
+ ours === null || ours === void 0 ? void 0 : ours(event);
22
+ theirs === null || theirs === void 0 ? void 0 : theirs(event);
23
+ };
24
+ }
25
+
26
+ export { composeEventHandlers };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,6 @@
1
1
  export { cn } from "./cn";
2
2
  export { debounce } from "./debounce";
3
+ export { composeEventHandlers } from "./composeEventHandlers";
3
4
  export { formatTimestamp, formatDate, formatTime, formatDateCustom, formatRelativeTime, isToday, isYesterday, isThisWeek, getLastNDays, getThisWeek, getLastWeek, getThisMonth, getLastMonth, getThisYear, getLastYear, toDate, addDays, isSameDay, isWeekend, getDaysBetween, getWeekNumber, type DateInput, type TimestampOptions, type DateRange, } from "./dateUtils";
4
5
  export { findNextMatchingOption, isValidTypeaheadChar, TYPEAHEAD_TIMEOUT_MS, type TypeaheadOption, type FindNextMatchingOptionParams, } from "./typeaheadUtils";
5
6
  export { parseOpenAI, parseAnthropic, parseGemini, parseSSELine, SSE_PARSERS, type SSEFormat, type SSEParser, } from "./sseFormatParsers";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flikk/ui",
3
- "version": "1.0.0-beta.32",
3
+ "version": "1.0.0-beta.33",
4
4
  "description": "A modern React component library built with TypeScript, Tailwind CSS v4, and Framer Motion. Follows the shadcn philosophy with complete className override support.",
5
5
  "type": "module",
6
6
  "packageManager": "yarn@1.22.22",
@@ -290,7 +290,7 @@
290
290
  --kpi-value-line-height-lg: 1.2;
291
291
 
292
292
  /* Form element variables โ€” fixed px so they don't scale with root font-size */
293
- --form-min-h-sm: 32px;
293
+ --form-min-h-sm: 28px;
294
294
  /* h-8 in Tailwind */
295
295
  --form-min-h-md: 36px;
296
296
  /* h-9 in Tailwind */
@@ -307,8 +307,9 @@
307
307
  --form-px-lg: 16px;
308
308
  /* px-4 in Tailwind */
309
309
 
310
- --form-py-sm: 8px;
311
- /* py-2 in Tailwind */
310
+ --form-py-sm: 6px;
311
+ /* 6px, not py-2's 8px: the sm rung is a 28px box around a 12px/16px line,
312
+ so 8px left a 12px content box for a 16px line. */
312
313
  --form-py-md: 10px;
313
314
  /* py-2.5 in Tailwind */
314
315
  --form-py-lg: 12px;
@@ -331,7 +332,7 @@
331
332
  Tailwind's arbitrary text-[โ€ฆ] syntax is ambiguous between colour and
332
333
  font-size and a bare var() resolves to the COLOUR branch, silently
333
334
  no-oping the size (see TYPE ROLE SYSTEM). */
334
- --form-text-size-sm: var(--text-sm);
335
+ --form-text-size-sm: var(--text-xs);
335
336
  --form-text-size-md: var(--text-sm);
336
337
  --form-text-size-lg: var(--text-base);
337
338
 
@@ -344,10 +345,30 @@
344
345
  that 20pxโ†’21px step. Values alias Tailwind's own pairing vars so the
345
346
  ramp stays byte-identical and --font-scale still flows through (the
346
347
  pairings are unitless ratios). */
347
- --form-line-height-sm: var(--text-sm--line-height);
348
+ --form-line-height-sm: var(--text-xs--line-height);
348
349
  --form-line-height-md: var(--text-sm--line-height);
349
350
  --form-line-height-lg: var(--text-base--line-height);
350
351
 
352
+ /* CONTROL ICON SIZE โ€” the GLYPH inside a field (chevron, clock, search,
353
+ check), NOT any button square.
354
+
355
+ ๐Ÿ”ด Do not confuse with --button-icon-square-* , which is the icon-only
356
+ BUTTON's box (aliased to --form-min-h-*). This family is the drawn icon.
357
+
358
+ Icons were the one axis of a field's geometry that was NOT themeable: a
359
+ preset could retune height, padding, radius and type, and every decorator
360
+ stayed a hardcoded size-4/size-5. So a scaled-up theme got 16px chevrons
361
+ rattling around a 48px field. The ramp is deliberately gentler than the
362
+ type ramp (12/14/16 against 14/14/16) โ€” an icon carries more optical mass
363
+ per px than a glyph of text, so matching type 1:1 reads heavy at sm.
364
+
365
+ Consumed as size-[var(--form-icon-size-โ€ฆ)] via formsBaseTheme.iconStyles.sizes.
366
+ Unlike --form-text-size-*, there is no line-height partner to pair โ€” an
367
+ icon is a box, not a line of text. */
368
+ --form-icon-size-sm: 12px;
369
+ --form-icon-size-md: 14px;
370
+ --form-icon-size-lg: 16px;
371
+
351
372
  /* ============================================
352
373
  OTP SLOT SIZING
353
374
  OTP slots are SQUARE, so this is one size token per rung, not a height +
@@ -524,10 +545,13 @@
524
545
  --button-icon-p-md: 8px;
525
546
  --button-icon-p-lg: 10px;
526
547
 
527
- /* Button icon-only sizes */
528
- --button-icon-size-sm: var(--form-min-h-sm);
529
- --button-icon-size-md: var(--form-min-h-md);
530
- --button-icon-size-lg: var(--form-min-h-lg);
548
+ /* Icon-only Button SQUARE โ€” the button's box, aliased to the form height so
549
+ an icon button lines up with the field beside it. Named `-square-`, not
550
+ `-size-`: it is not the size of the icon (that is --form-icon-size-*, and
551
+ two tokens both called `icon-size` meaning different things is a trap). */
552
+ --button-icon-square-sm: var(--form-min-h-sm);
553
+ --button-icon-square-md: var(--form-min-h-md);
554
+ --button-icon-square-lg: var(--form-min-h-lg);
531
555
 
532
556
  /* Badge variables.
533
557
  Radius derives from --radius-base like every other CONTROL (Button/Input/