@arolariu/components 0.3.1 → 0.4.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 (98) hide show
  1. package/EXAMPLES.md +1035 -1035
  2. package/changelog.md +5 -0
  3. package/dist/components/ui/accordion.js.map +1 -1
  4. package/dist/components/ui/alert-dialog.js.map +1 -1
  5. package/dist/components/ui/alert.js.map +1 -1
  6. package/dist/components/ui/aspect-ratio.js.map +1 -1
  7. package/dist/components/ui/avatar.js.map +1 -1
  8. package/dist/components/ui/background-beams.js.map +1 -1
  9. package/dist/components/ui/badge.js.map +1 -1
  10. package/dist/components/ui/breadcrumb.js.map +1 -1
  11. package/dist/components/ui/bubble-background.js.map +1 -1
  12. package/dist/components/ui/button-group.js.map +1 -1
  13. package/dist/components/ui/button.js.map +1 -1
  14. package/dist/components/ui/calendar.js.map +1 -1
  15. package/dist/components/ui/card.js.map +1 -1
  16. package/dist/components/ui/carousel.js.map +1 -1
  17. package/dist/components/ui/chart.js.map +1 -1
  18. package/dist/components/ui/checkbox.js +2 -2
  19. package/dist/components/ui/checkbox.js.map +1 -1
  20. package/dist/components/ui/collapsible.d.ts +2 -1
  21. package/dist/components/ui/collapsible.d.ts.map +1 -1
  22. package/dist/components/ui/collapsible.js +2 -30
  23. package/dist/components/ui/collapsible.js.map +1 -1
  24. package/dist/components/ui/command.js.map +1 -1
  25. package/dist/components/ui/context-menu.js.map +1 -1
  26. package/dist/components/ui/counting-number.js.map +1 -1
  27. package/dist/components/ui/dialog.js.map +1 -1
  28. package/dist/components/ui/dot-background.js.map +1 -1
  29. package/dist/components/ui/drawer.js.map +1 -1
  30. package/dist/components/ui/dropdown-menu.js.map +1 -1
  31. package/dist/components/ui/dropdrawer.js.map +1 -1
  32. package/dist/components/ui/empty.js.map +1 -1
  33. package/dist/components/ui/field.js +1 -1
  34. package/dist/components/ui/field.js.map +1 -1
  35. package/dist/components/ui/fireworks-background.js.map +1 -1
  36. package/dist/components/ui/flip-button.js.map +1 -1
  37. package/dist/components/ui/form.d.ts.map +1 -1
  38. package/dist/components/ui/form.js +4 -3
  39. package/dist/components/ui/form.js.map +1 -1
  40. package/dist/components/ui/gradient-background.js.map +1 -1
  41. package/dist/components/ui/gradient-text.js.map +1 -1
  42. package/dist/components/ui/highlight-text.js.map +1 -1
  43. package/dist/components/ui/hole-background.js.map +1 -1
  44. package/dist/components/ui/hover-card.js.map +1 -1
  45. package/dist/components/ui/input-group.d.ts.map +1 -1
  46. package/dist/components/ui/input-group.js.map +1 -1
  47. package/dist/components/ui/input-otp.js.map +1 -1
  48. package/dist/components/ui/input.js.map +1 -1
  49. package/dist/components/ui/item.js.map +1 -1
  50. package/dist/components/ui/kbd.js.map +1 -1
  51. package/dist/components/ui/label.js.map +1 -1
  52. package/dist/components/ui/menubar.js.map +1 -1
  53. package/dist/components/ui/navigation-menu.js.map +1 -1
  54. package/dist/components/ui/pagination.js.map +1 -1
  55. package/dist/components/ui/popover.js.map +1 -1
  56. package/dist/components/ui/progress.js.map +1 -1
  57. package/dist/components/ui/radio-group.js.map +1 -1
  58. package/dist/components/ui/resizable.js.map +1 -1
  59. package/dist/components/ui/ripple-button.js.map +1 -1
  60. package/dist/components/ui/scratcher.js.map +1 -1
  61. package/dist/components/ui/scroll-area.js.map +1 -1
  62. package/dist/components/ui/select.js.map +1 -1
  63. package/dist/components/ui/separator.js.map +1 -1
  64. package/dist/components/ui/sheet.js.map +1 -1
  65. package/dist/components/ui/sidebar.d.ts.map +1 -1
  66. package/dist/components/ui/sidebar.js.map +1 -1
  67. package/dist/components/ui/skeleton.js.map +1 -1
  68. package/dist/components/ui/slider.js.map +1 -1
  69. package/dist/components/ui/sonner.js.map +1 -1
  70. package/dist/components/ui/spinner.js.map +1 -1
  71. package/dist/components/ui/switch.js.map +1 -1
  72. package/dist/components/ui/table.d.ts.map +1 -1
  73. package/dist/components/ui/table.js.map +1 -1
  74. package/dist/components/ui/tabs.js.map +1 -1
  75. package/dist/components/ui/textarea.js.map +1 -1
  76. package/dist/components/ui/toggle-group.js.map +1 -1
  77. package/dist/components/ui/toggle.js.map +1 -1
  78. package/dist/components/ui/tooltip.js.map +1 -1
  79. package/dist/components/ui/typewriter.js +6 -2
  80. package/dist/components/ui/typewriter.js.map +1 -1
  81. package/dist/hooks/useIsMobile.js.map +1 -1
  82. package/dist/hooks/useWindowSize.js.map +1 -1
  83. package/dist/index.css +25 -1779
  84. package/dist/index.css.map +1 -1
  85. package/dist/lib/utilities.js.map +1 -1
  86. package/package.json +2 -15
  87. package/src/components/ui/chart.tsx +1 -1
  88. package/src/components/ui/checkbox.tsx +2 -2
  89. package/src/components/ui/collapsible.tsx +3 -1
  90. package/src/components/ui/field.tsx +1 -1
  91. package/src/components/ui/form.tsx +8 -4
  92. package/src/components/ui/input-group.tsx +2 -0
  93. package/src/components/ui/sidebar.tsx +2 -0
  94. package/src/components/ui/table.tsx +2 -0
  95. package/src/components/ui/typewriter.tsx +2 -2
  96. package/src/index.css +6 -6
  97. package/dist/components/ui/field.d.ts +0 -26
  98. package/dist/components/ui/field.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"lib\\utilities.js","sources":["webpack://@arolariu/components/./src/lib/utilities.ts"],"sourcesContent":["import {clsx, type ClassValue} from \"clsx\";\r\nimport {twMerge} from \"tailwind-merge\";\r\n\r\n/**\r\n * Helper function that merges tailwindcss\r\n * class names in the given input array.\r\n * @param inputs Array of class names\r\n * @returns Merged class names\r\n */\r\nexport function cn(...inputs: ReadonlyArray<ClassValue>): Readonly<string> {\r\n return twMerge(clsx(inputs));\r\n}\r\n"],"names":["cn","inputs","twMerge","clsx"],"mappings":";;AASO,SAASA,GAAG,GAAGC,MAAiC;IACrD,OAAOC,QAAQC,KAAKF;AACtB"}
1
+ {"version":3,"file":"lib/utilities.js","sources":["../../src/lib/utilities.ts"],"sourcesContent":["import {clsx, type ClassValue} from \"clsx\";\r\nimport {twMerge} from \"tailwind-merge\";\r\n\r\n/**\r\n * Helper function that merges tailwindcss\r\n * class names in the given input array.\r\n * @param inputs Array of class names\r\n * @returns Merged class names\r\n */\r\nexport function cn(...inputs: ReadonlyArray<ClassValue>): Readonly<string> {\r\n return twMerge(clsx(inputs));\r\n}\r\n"],"names":["cn","inputs","twMerge","clsx"],"mappings":";;AASO,SAASA,GAAG,GAAGC,MAAiC;IACrD,OAAOC,QAAQC,KAAKF;AACtB"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arolariu/components",
3
3
  "displayName": "@arolariu/components",
4
- "version": "0.3.1",
4
+ "version": "0.4.0",
5
5
  "description": "🎨 70+ beautiful, accessible React components built on Radix UI. TypeScript-first, tree-shakeable, SSR-ready. Perfect for modern web apps, design systems & rapid prototyping. Zero config, maximum flexibility! ⚡",
6
6
  "homepage": "https://arolariu.ro",
7
7
  "repository": {
@@ -81,9 +81,7 @@
81
81
  "build:before": "node scripts/beforeBuild.ts",
82
82
  "build:after": "node scripts/afterBuild.ts",
83
83
  "build:clean": "rimraf dist",
84
- "build:exports": "node scripts/generate-exports.ts",
85
- "build:storybook": "storybook build",
86
- "storybook": "storybook dev -p 6006"
84
+ "build:exports": "node scripts/generate-exports.ts"
87
85
  },
88
86
  "dependencies": {
89
87
  "@hookform/resolvers": "*",
@@ -143,13 +141,6 @@
143
141
  "@rsbuild/core": "*",
144
142
  "@rsbuild/plugin-react": "*",
145
143
  "@rslib/core": "*",
146
- "@storybook/addon-a11y": "*",
147
- "@storybook/addon-docs": "*",
148
- "@storybook/addon-essentials": "*",
149
- "@storybook/addon-interactions": "*",
150
- "@storybook/addon-links": "*",
151
- "@storybook/addon-storysource": "*",
152
- "@storybook/addon-themes": "*",
153
144
  "@tailwindcss/postcss": "*",
154
145
  "@types/node": "*",
155
146
  "@types/react": "*",
@@ -160,10 +151,6 @@
160
151
  "react": "*",
161
152
  "react-dom": "*",
162
153
  "rimraf": "*",
163
- "storybook": "*",
164
- "storybook-addon-rslib": "*",
165
- "storybook-builder-rsbuild": "*",
166
- "storybook-react-rsbuild": "*",
167
154
  "tailwindcss": "*",
168
155
  "typescript": "*"
169
156
  },
@@ -275,7 +275,7 @@ ChartLegendContent.displayName = "ChartLegend";
275
275
  // Helper to extract item config from a payload.
276
276
  function getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string) {
277
277
  if (typeof payload !== "object" || payload === null) {
278
- return;
278
+ return undefined;
279
279
  }
280
280
 
281
281
  const payloadPayload =
@@ -13,11 +13,11 @@ const Checkbox = React.forwardRef<
13
13
  <CheckboxPrimitive.Root
14
14
  ref={ref}
15
15
  className={cn(
16
- "peer h-4 w-4 shrink-0 rounded-sm border border-neutral-200 border-neutral-900 shadow focus-visible:ring-1 focus-visible:ring-neutral-950 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-neutral-900 data-[state=checked]:text-neutral-50 dark:border-neutral-50 dark:border-neutral-800 dark:focus-visible:ring-neutral-300 dark:data-[state=checked]:bg-neutral-50 dark:data-[state=checked]:text-neutral-900",
16
+ "peer grid h-4 w-4 shrink-0 place-content-center rounded-sm border border-neutral-200 border-neutral-900 shadow focus-visible:ring-1 focus-visible:ring-neutral-950 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-neutral-900 data-[state=checked]:text-neutral-50 dark:border-neutral-50 dark:border-neutral-800 dark:focus-visible:ring-neutral-300 dark:data-[state=checked]:bg-neutral-50 dark:data-[state=checked]:text-neutral-900",
17
17
  className,
18
18
  )}
19
19
  {...props}>
20
- <CheckboxPrimitive.Indicator className={cn("flex items-center justify-center text-current")}>
20
+ <CheckboxPrimitive.Indicator className={cn("grid place-content-center text-current")}>
21
21
  <Check className='h-4 w-4' />
22
22
  </CheckboxPrimitive.Indicator>
23
23
  </CheckboxPrimitive.Root>
@@ -4,6 +4,8 @@ import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
4
4
 
5
5
  const Collapsible = CollapsiblePrimitive.Root;
6
6
 
7
- const {CollapsibleTrigger, CollapsibleContent} = CollapsiblePrimitive;
7
+ const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
8
+
9
+ const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;
8
10
 
9
11
  export {Collapsible, CollapsibleContent, CollapsibleTrigger};
@@ -141,7 +141,7 @@ function FieldSeparator({
141
141
  className={cn("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", className)}
142
142
  {...props}>
143
143
  <Separator className='absolute inset-0 top-1/2' />
144
- {children && (
144
+ {Boolean(children) && (
145
145
  <span
146
146
  className='relative mx-auto block w-fit bg-white px-2 text-neutral-500 dark:bg-neutral-950 dark:text-neutral-400'
147
147
  data-slot='field-separator-content'>
@@ -17,7 +17,7 @@ type FormFieldContextValue<
17
17
  name: TName;
18
18
  };
19
19
 
20
- const FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue);
20
+ const FormFieldContext = React.createContext<FormFieldContextValue | null>(null);
21
21
 
22
22
  const FormField = <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({
23
23
  ...props
@@ -34,12 +34,16 @@ const useFormField = () => {
34
34
  const itemContext = React.useContext(FormItemContext);
35
35
  const {getFieldState, formState} = useFormContext();
36
36
 
37
- const fieldState = getFieldState(fieldContext.name, formState);
38
-
39
37
  if (!fieldContext) {
40
38
  throw new Error("useFormField should be used within <FormField>");
41
39
  }
42
40
 
41
+ if (!itemContext) {
42
+ throw new Error("useFormField should be used within <FormItem>");
43
+ }
44
+
45
+ const fieldState = getFieldState(fieldContext.name, formState);
46
+
43
47
  const {id} = itemContext;
44
48
 
45
49
  return {
@@ -56,7 +60,7 @@ type FormItemContextValue = {
56
60
  id: string;
57
61
  };
58
62
 
59
- const FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue);
63
+ const FormItemContext = React.createContext<FormItemContextValue | null>(null);
60
64
 
61
65
  const FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({className, ...props}, ref) => {
62
66
  const id = React.useId();
@@ -1,5 +1,7 @@
1
1
  "use client";
2
2
 
3
+ /* eslint-disable */
4
+
3
5
  import {cva, type VariantProps} from "class-variance-authority";
4
6
  import * as React from "react";
5
7
 
@@ -1,5 +1,7 @@
1
1
  "use client";
2
2
 
3
+ /* eslint-disable */
4
+
3
5
  import {Slot} from "@radix-ui/react-slot";
4
6
  import {VariantProps, cva} from "class-variance-authority";
5
7
  import {PanelLeft} from "lucide-react";
@@ -1,5 +1,7 @@
1
1
  "use client";
2
2
 
3
+ /* eslint-disable */
4
+
3
5
  import * as React from "react";
4
6
 
5
7
  import {cn} from "@/lib/utilities";
@@ -20,7 +20,7 @@ export const TypewriterText = ({
20
20
  const wordsArray = words.map((word) => {
21
21
  return {
22
22
  ...word,
23
- text: word.text.split(""),
23
+ text: [...word.text],
24
24
  };
25
25
  });
26
26
 
@@ -105,7 +105,7 @@ export const TypewriterTextSmooth = ({
105
105
  const wordsArray = words.map((word) => {
106
106
  return {
107
107
  ...word,
108
- text: word.text.split(""),
108
+ text: [...word.text],
109
109
  };
110
110
  });
111
111
  const renderWords = () => {
package/src/index.css CHANGED
@@ -1,12 +1,12 @@
1
1
  @import "tailwindcss";
2
2
  @config '../tailwind.config.ts';
3
3
  @custom-variant dark (&:is(.dark *));
4
-
4
+
5
5
  /*
6
6
  The default border color has changed to `currentcolor` in Tailwind CSS v4,
7
7
  so we've added these compatibility styles to make sure everything still
8
8
  looks the same as it did with Tailwind CSS v3.
9
-
9
+
10
10
  If we ever want to remove these styles, we need to add an explicit border
11
11
  color utility to any element that depends on these defaults.
12
12
  */
@@ -19,7 +19,7 @@
19
19
  border-color: var(--color-gray-200, currentcolor);
20
20
  }
21
21
  }
22
-
22
+
23
23
  :root {
24
24
  --sidebar: hsl(0 0% 98%);
25
25
  --sidebar-foreground: hsl(240 5.3% 26.1%);
@@ -40,7 +40,7 @@
40
40
  --sidebar-border: hsl(240 3.7% 15.9%);
41
41
  --sidebar-ring: hsl(217.2 91.2% 59.8%);
42
42
  }
43
-
43
+
44
44
  @theme inline {
45
45
  --color-sidebar: var(--sidebar);
46
46
  --color-sidebar-foreground: var(--sidebar-foreground);
@@ -52,7 +52,7 @@
52
52
  --color-sidebar-ring: var(--sidebar-ring);
53
53
  --animate-accordion-down: accordion-down 0.2s ease-out;
54
54
  --animate-accordion-up: accordion-up 0.2s ease-out;
55
-
55
+
56
56
  @keyframes accordion-down {
57
57
  from {
58
58
  height: 0;
@@ -61,7 +61,7 @@
61
61
  height: var(--radix-accordion-content-height);
62
62
  }
63
63
  }
64
-
64
+
65
65
  @keyframes accordion-up {
66
66
  from {
67
67
  height: var(--radix-accordion-content-height);
@@ -1,26 +0,0 @@
1
- import { type VariantProps } from "class-variance-authority";
2
- import * as React from "react";
3
- import { Label } from "./label";
4
- declare function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">): import("react/jsx-runtime").JSX.Element;
5
- declare function FieldLegend({ className, variant, ...props }: React.ComponentProps<"legend"> & {
6
- variant?: "legend" | "label";
7
- }): import("react/jsx-runtime").JSX.Element;
8
- declare function FieldGroup({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
9
- declare const fieldVariants: (props?: {
10
- orientation?: "horizontal" | "vertical" | "responsive";
11
- } & import("class-variance-authority/types").ClassProp) => string;
12
- declare function Field({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>): import("react/jsx-runtime").JSX.Element;
13
- declare function FieldContent({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
14
- declare function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>): import("react/jsx-runtime").JSX.Element;
15
- declare function FieldTitle({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
16
- declare function FieldDescription({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
17
- declare function FieldSeparator({ children, className, ...props }: React.ComponentProps<"div"> & {
18
- children?: React.ReactNode;
19
- }): import("react/jsx-runtime").JSX.Element;
20
- declare function FieldError({ className, children, errors, ...props }: React.ComponentProps<"div"> & {
21
- errors?: Array<{
22
- message?: string;
23
- } | undefined>;
24
- }): import("react/jsx-runtime").JSX.Element;
25
- export { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle };
26
- //# sourceMappingURL=field.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../src/components/ui/field.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAM,KAAK,YAAY,EAAC,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,KAAK,EAAC,MAAM,uBAAuB,CAAC;AAI5C,iBAAS,QAAQ,CAAC,EAAC,SAAS,EAAE,GAAG,KAAK,EAAC,EAAE,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,2CAQxE;AAED,iBAAS,WAAW,CAAC,EAAC,SAAS,EAAE,OAAkB,EAAE,GAAG,KAAK,EAAC,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG;IAAC,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAA;CAAC,2CAS9H;AAED,iBAAS,UAAU,CAAC,EAAC,SAAS,EAAE,GAAG,KAAK,EAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWrE;AAED,QAAA,MAAM,aAAa;;iEAmBjB,CAAC;AAEH,iBAAS,KAAK,CAAC,EAAC,SAAS,EAAE,WAAwB,EAAE,GAAG,KAAK,EAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,2CAU/H;AAED,iBAAS,YAAY,CAAC,EAAC,SAAS,EAAE,GAAG,KAAK,EAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQvE;AAED,iBAAS,UAAU,CAAC,EAAC,SAAS,EAAE,GAAG,KAAK,EAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,2CAa5E;AAED,iBAAS,UAAU,CAAC,EAAC,SAAS,EAAE,GAAG,KAAK,EAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWrE;AAED,iBAAS,gBAAgB,CAAC,EAAC,SAAS,EAAE,GAAG,KAAK,EAAC,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,2CAazE;AAED,iBAAS,cAAc,CAAC,EACtB,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,2CAiBA;AAED,iBAAS,UAAU,CAAC,EAClB,SAAS,EACT,QAAQ,EACR,MAAM,EACN,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC/B,MAAM,CAAC,EAAE,KAAK,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAC,GAAG,SAAS,CAAC,CAAC;CAChD,2CAmCA;AAED,OAAO,EAAC,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAC,CAAC"}