torch-glare 2.5.3 → 2.5.4

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 (32) hide show
  1. package/apps/lib/components/ActionButton.tsx +39 -6
  2. package/apps/lib/components/Badge.tsx +5 -2
  3. package/apps/lib/components/BadgeField.tsx +1 -1
  4. package/apps/lib/components/Button.tsx +4 -4
  5. package/apps/lib/components/Calendar.tsx +7 -17
  6. package/apps/lib/components/ColorPicker.tsx +1 -1
  7. package/apps/lib/components/DataViews/views/table-view.tsx +33 -4
  8. package/apps/lib/components/Drawer.tsx +18 -1
  9. package/apps/lib/components/FormRenderer/stepper.tsx +22 -16
  10. package/apps/lib/components/Input.tsx +19 -4
  11. package/apps/lib/components/Popover.tsx +93 -55
  12. package/apps/lib/components/SearchableSelect.tsx +12 -11
  13. package/apps/lib/components/SearchableTree.tsx +10 -11
  14. package/apps/lib/components/SearchableTreeDialog.tsx +10 -11
  15. package/apps/lib/components/SectionBlock.tsx +3 -1
  16. package/apps/lib/components/Select.tsx +35 -11
  17. package/apps/lib/components/SimpleSelect.tsx +2 -2
  18. package/apps/lib/components/SlideDatePicker.tsx +17 -4
  19. package/apps/lib/components/Stepper.tsx +329 -180
  20. package/apps/lib/components/Switch.tsx +2 -2
  21. package/apps/lib/components/Table.tsx +1 -1
  22. package/apps/lib/components/Textarea.tsx +29 -4
  23. package/apps/lib/components/TreeDropDown.tsx +18 -6
  24. package/apps/lib/registry.json +7 -16
  25. package/apps/lib/tsconfig.tsbuildinfo +1 -1
  26. package/docs/components/action-button.md +3 -1
  27. package/docs/components/stepper.md +119 -24
  28. package/docs/reference/tailwind-plugins.md +42 -0
  29. package/docs/tutorials/getting-started.md +32 -11
  30. package/package.json +1 -1
  31. package/apps/lib/components/FormStepper.tsx +0 -272
  32. package/docs/components/form-stepper.md +0 -250
@@ -7,12 +7,19 @@ import { cva, VariantProps } from "class-variance-authority";
7
7
  const textareaStyles = cva(
8
8
  [
9
9
  "border",
10
- "rounded-[8px]",
10
+ // `radius/xl` (12px). Figma's TextArea-Field has two sizes — S is `radius/lg` (8px) and M is
11
+ // `radius/xl` — and this component has no size variant: it renders its `Label` wrapper at
12
+ // `size="M"` below, so M is the size it actually is. Supporting S properly needs a real `size`
13
+ // prop, which is an API change rather than a radius one.
14
+ "rounded-radius-xl",
11
15
  "px-[8px]",
12
16
  "py-[12px]",
13
17
  "outline-none",
14
18
  "typography-body-large-regular",
15
- "!min-h-[36px]",
19
+ // A floor for the empty field — without one, `field-sizing: content` collapses it to a single
20
+ // 50px line. No `!` — twMerge does not dedupe an important class against a plain one, so `!`
21
+ // here would make the height impossible to override from a caller's `className`.
22
+ "min-h-[200px]",
16
23
  "transition-[border,background-color,color,caret-color,box-shadow]",
17
24
  "ease-in-out",
18
25
  "duration-150",
@@ -29,7 +36,7 @@ const textareaStyles = cva(
29
36
  "disabled:text-border-presentation-action-disabled",
30
37
  "disabled:cursor-not-allowed",
31
38
  "disabled:placeholder-border-presentation-action-disabled",
32
- "field-sizing-content w-full min-w-[100px] max-w-[100%]",
39
+ "w-full min-w-[100px] max-w-[100%]",
33
40
  ],
34
41
  {
35
42
  variants: {
@@ -54,6 +61,14 @@ interface TextareaProps
54
61
  secondaryLabel?: string; // Additional label text
55
62
  direction?: "row" | "column";
56
63
  theme?: "dark" | "light" | "default";
64
+ /**
65
+ * Grow the field to fit its content as the user types, instead of scrolling inside a fixed box.
66
+ * On by default, via CSS `field-sizing: content`. Set a `max-h-*` on the field to cap the growth —
67
+ * past the cap it scrolls. Note `rows` has no effect while this is on: the browser sizes the field
68
+ * from its content, so an empty field starts at one line. Pass `autoResize={false}` for the old
69
+ * fixed-height box with a drag handle.
70
+ */
71
+ autoResize?: boolean;
57
72
  }
58
73
 
59
74
  // Textarea component definition
@@ -68,6 +83,7 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
68
83
  direction = "row",
69
84
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
70
85
  theme, // excluded from ...props spread
86
+ autoResize = true,
71
87
  ...props
72
88
  },
73
89
  ref,
@@ -82,7 +98,16 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
82
98
  size={"M"}
83
99
  className={cn(className)}
84
100
  >
85
- <textarea className={cn(textareaStyles({ state }))} ref={ref} {...props} />
101
+ <textarea
102
+ // Auto-grow is pure CSS. Written as an arbitrary *property* rather than as
103
+ // `field-sizing-content`: that utility only exists in Tailwind v4 and this project is on
104
+ // v3, where it compiled to no rule at all and left the computed `field-sizing` at `fixed`.
105
+ // The drag handle goes away with it — the height is content-driven, and a manual drag
106
+ // would pin it and silently stop the growing.
107
+ className={cn(textareaStyles({ state }), autoResize && "[field-sizing:content] resize-none")}
108
+ ref={ref}
109
+ {...props}
110
+ />
86
111
  </Label>
87
112
  );
88
113
  },
@@ -6,9 +6,9 @@ import { HTMLAttributes, ReactNode, useEffect, useState } from "react";
6
6
  const TreeDropDownVariants = cva(
7
7
  [
8
8
  "cursor-pointer flex px-[6px] h-[40px] gap-2 justify-start items-center w-full",
9
- "text-content-system-global-primary border-l-[2px] rtl:border-r-[2px] border-transparent outline-none",
9
+ "text-content-system-global-primary border-s-[2px] border-transparent outline-none",
10
10
  "hover:bg-white-alpha-075 hover:border-black-300 hover:text-content-system-action-primary-hover hover:gap-[14px]",
11
- "rounded-r-[4px] text-start whitespace-nowrap transition-all duration-150 ease-in-out",
11
+ "rounded-e-[4px] text-start whitespace-nowrap transition-all duration-150 ease-in-out",
12
12
  ],
13
13
  {
14
14
  variants: {
@@ -20,19 +20,31 @@ const TreeDropDownVariants = cva(
20
20
  true: "hover:gap-[8px]",
21
21
  },
22
22
  },
23
+ // The active row is a fixed dark slab, so its colours are pinned locally rather than taken from
24
+ // the theme. Previously the fill was theme-invariant while the text was not: on a light-themed
25
+ // page the row rendered near-black with near-black text, and the label was unreadable. The
26
+ // values below are exactly what the dark sidebar already rendered, so its look is unchanged.
23
27
  compoundVariants: [
24
28
  {
25
29
  active: true,
26
30
  variant: "default",
27
31
  className: [
28
- "bg-background-system-action-primary-hover border-border-system-action-primary-hover [&_button]:bg-purple-alpha-15 hover:bg-background-system-action-primary-hover hover:border-border-system-action-primary-hover",
32
+ "bg-purple-1000 border-purple-600 [&_button]:bg-purple-alpha-15",
33
+ "hover:bg-purple-1000 hover:border-purple-600",
34
+ // Descendants carry their own theme-driven text colours (headings, badges), so the
35
+ // foreground has to be forced here or it follows the page instead of the slab.
36
+ "text-content-presentation-global-primary-light",
37
+ "[&_*]:!text-content-presentation-global-primary-light",
29
38
  ],
30
39
  },
31
40
  {
32
41
  active: true,
33
42
  variant: "secondary",
34
43
  className: [
35
- "bg-wavy-navy-1000 border-border-system-action-field-hover-selected [&_button]:bg-blue-sparkle-alpha-15 hover:bg-wavy-navy-1000 hover:border-border-system-action-field-hover-selected",
44
+ "bg-wavy-navy-1000 border-blue-sparkle-600 [&_button]:bg-blue-sparkle-alpha-15",
45
+ "hover:bg-wavy-navy-1000 hover:border-blue-sparkle-600",
46
+ "text-content-presentation-global-primary-light",
47
+ "[&_*]:!text-content-presentation-global-primary-light",
36
48
  ],
37
49
  },
38
50
  ],
@@ -86,14 +98,14 @@ export const TreeDropDown = ({
86
98
  </div>
87
99
  <div
88
100
  className={cn(
89
- "mt-0 pl-[22px] relative overflow-auto scrollbar-hide transition-all duration-500 ease-in-out",
101
+ "mt-0 ps-[22px] relative overflow-auto scrollbar-hide transition-all duration-500 ease-in-out",
90
102
  {
91
103
  "max-h-[20000px] mt-1": isActive,
92
104
  "max-h-0": !isActive,
93
105
  },
94
106
  )}
95
107
  >
96
- <span className="h-full w-[1px] bg-border-system-global-primary absolute left-[21px] top-0 rounded-sm z-10" />
108
+ <span className="h-full w-[1px] bg-border-system-global-primary absolute start-[21px] top-0 rounded-sm z-10" />
97
109
  <div className={cn("h-full flex flex-col gap-1 w-full", childrenContainerClassName)}>
98
110
  {props.children}
99
111
  </div>
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.5.3",
2
+ "version": "2.5.4",
3
3
  "generatedBy": "scripts/bin/generateRegistry",
4
4
  "npmVersions": {
5
5
  "@dnd-kit/core": "^6.3.1",
@@ -186,7 +186,7 @@
186
186
  "react-day-picker"
187
187
  ],
188
188
  "registryDependencies": [
189
- "components/Button",
189
+ "components/ActionButton",
190
190
  "components/SimpleSelect",
191
191
  "utils/cn"
192
192
  ]
@@ -457,25 +457,13 @@
457
457
  "components/Button",
458
458
  "components/Drawer",
459
459
  "components/FormBuilder",
460
- "components/FormStepper",
461
460
  "components/HeaderBar",
462
461
  "components/SectionBlock",
462
+ "components/Stepper",
463
463
  "components/TabFormItem",
464
464
  "utils/cn"
465
465
  ]
466
466
  },
467
- {
468
- "name": "FormStepper",
469
- "type": "components",
470
- "path": "components/FormStepper.tsx",
471
- "npmDependencies": [
472
- "class-variance-authority"
473
- ],
474
- "registryDependencies": [
475
- "utils/cn",
476
- "utils/types"
477
- ]
478
- },
479
467
  {
480
468
  "name": "FormSummary",
481
469
  "type": "components",
@@ -714,6 +702,7 @@
714
702
  "class-variance-authority"
715
703
  ],
716
704
  "registryDependencies": [
705
+ "components/ActionButton",
717
706
  "components/Button",
718
707
  "components/DropdownMenu",
719
708
  "components/Input",
@@ -743,6 +732,7 @@
743
732
  "path": "components/SearchableTree.tsx",
744
733
  "npmDependencies": [],
745
734
  "registryDependencies": [
735
+ "components/ActionButton",
746
736
  "components/Button",
747
737
  "components/Input",
748
738
  "components/Popover",
@@ -757,6 +747,7 @@
757
747
  "path": "components/SearchableTreeDialog.tsx",
758
748
  "npmDependencies": [],
759
749
  "registryDependencies": [
750
+ "components/ActionButton",
760
751
  "components/Button",
761
752
  "components/Dialog",
762
753
  "components/Input",
@@ -793,7 +784,7 @@
793
784
  "class-variance-authority"
794
785
  ],
795
786
  "registryDependencies": [
796
- "components/Button",
787
+ "components/ActionButton",
797
788
  "components/DropdownMenu",
798
789
  "components/Tooltip",
799
790
  "utils/cn",