laif-ds 0.1.59 → 0.1.61

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.
package/README.md CHANGED
@@ -1,14 +1,18 @@
1
1
  ## PUBBLICARE:
2
+
2
3
  npm login
3
4
  npm whoami (verifica se sei loggato con accoutn corretto)
4
5
  yarn build (farà partire build per tailwindv3 e tailwindv4)
5
6
  npm publish --access public
6
7
 
7
8
  ## INSTALL:
9
+
8
10
  npm i @laif/ds
9
11
 
10
12
  ## HOW IT WORKS
13
+
11
14
  Per vedere i componenti con storybook:
15
+
12
16
  ```
13
17
  yarn storybook
14
18
  ```
@@ -26,23 +30,30 @@ Una story è definita in un file con estensione `.stories.tsx` (o `.stories.jsx`
26
30
 
27
31
  ```tsx
28
32
  // button.stories.tsx
29
- import type { Meta, StoryObj } from '@storybook/react';
30
- import { Button } from '../ui/button';
33
+ import type { Meta, StoryObj } from "@storybook/react";
34
+ import { Button } from "../ui/button";
31
35
 
32
36
  // Metadati del componente
33
37
  const meta = {
34
- title: 'UI/Button', // Categoria/Nome nella sidebar di Storybook
35
- component: Button, // Il componente da documentare
38
+ title: "UI/Button", // Categoria/Nome nella sidebar di Storybook
39
+ component: Button, // Il componente da documentare
36
40
  parameters: {
37
- layout: 'centered', // Layout della preview
41
+ layout: "centered", // Layout della preview
38
42
  },
39
- tags: ['autodocs'], // Genera automaticamente la documentazione
43
+ tags: ["autodocs"], // Genera automaticamente la documentazione
40
44
  argTypes: {
41
45
  // Definizione dei controlli per i props
42
46
  variant: {
43
- control: 'select',
44
- options: ['default', 'destructive', 'outline', 'secondary', 'ghost', 'link'],
45
- description: 'La variante visiva del bottone',
47
+ control: "select",
48
+ options: [
49
+ "default",
50
+ "destructive",
51
+ "outline",
52
+ "secondary",
53
+ "ghost",
54
+ "link",
55
+ ],
56
+ description: "La variante visiva del bottone",
46
57
  },
47
58
  // Altri argTypes...
48
59
  },
@@ -54,17 +65,17 @@ type Story = StoryObj<typeof meta>;
54
65
  // Definizione delle singole stories
55
66
  export const Default: Story = {
56
67
  args: {
57
- children: 'Button',
58
- variant: 'default',
59
- size: 'default',
68
+ children: "Button",
69
+ variant: "default",
70
+ size: "default",
60
71
  },
61
72
  };
62
73
 
63
74
  export const Secondary: Story = {
64
75
  args: {
65
- children: 'Button',
66
- variant: 'secondary',
67
- size: 'default',
76
+ children: "Button",
77
+ variant: "secondary",
78
+ size: "default",
68
79
  },
69
80
  };
70
81
 
@@ -80,8 +91,8 @@ export const Secondary: Story = {
80
91
  5. Definisci il tipo Story con `type Story = StoryObj<typeof meta>`
81
92
  6. Crea le diverse varianti del componente esportando costanti di tipo Story
82
93
 
83
-
84
94
  ### Colors
95
+
85
96
  Qui è definito il tema base di laif. Sovrascrivibile nel progetto che lo implementa.
86
97
  Per farlo basta cambiare i valori delle variabili.
87
- Di seguito sono importati 3 temi per demostrazione generati con (https://tweakcn.com/editor/theme)
98
+ Di seguito sono importati 3 temi per demostrazione generati con (https://tweakcn.com/editor/theme)
@@ -1,8 +1,5 @@
1
1
  "use client";
2
- import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
3
- import { __require as e } from "../node_modules/style-to-js/cjs/index.js";
4
- var t = e();
5
- const a = /* @__PURE__ */ r(t);
2
+ var e = { exports: {} };
6
3
  export {
7
- a as default
4
+ e as __module
8
5
  };
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
3
- import { __require as r } from "../node_modules/extend/index.js";
4
- var t = r();
5
- const x = /* @__PURE__ */ e(t);
2
+ import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
3
+ import { __require as e } from "../node_modules/style-to-js/cjs/index.js";
4
+ var t = e();
5
+ const a = /* @__PURE__ */ r(t);
6
6
  export {
7
- x as default
7
+ a as default
8
8
  };
@@ -1,5 +1,8 @@
1
1
  "use client";
2
- var e = { exports: {} };
2
+ import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
3
+ import { __require as r } from "../node_modules/extend/index.js";
4
+ var t = r();
5
+ const x = /* @__PURE__ */ e(t);
3
6
  export {
4
- e as __module
7
+ x as default
5
8
  };
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { jsxs as r, jsx as t } from "react/jsx-runtime";
3
- import { Select as h, SelectTrigger as C, SelectValue as i, SelectContent as B, SelectItem as j } from "./select.js";
3
+ import { Select as h, SelectTrigger as C, SelectValue as i, SelectContent as B, SelectItem as w } from "./select.js";
4
4
  import { SelectGroup as T, SelectLabel as U, SelectScrollDownButton as V, SelectScrollUpButton as b, SelectSeparator as v } from "./select.js";
5
- function I({
5
+ function G({
6
6
  options: o,
7
7
  placeholder: u,
8
8
  children: m,
@@ -14,13 +14,13 @@ function I({
14
14
  isOptionDisabled: c,
15
15
  ...A
16
16
  }) {
17
- return /* @__PURE__ */ r(h, { ...A, label: d, children: [
18
- m || /* @__PURE__ */ t(C, { className: x, children: /* @__PURE__ */ t(i, { placeholder: u }) }),
17
+ return /* @__PURE__ */ r(h, { ...A, label: d, className: x, children: [
18
+ m || /* @__PURE__ */ t(C, { className: "w-full", children: /* @__PURE__ */ t(i, { placeholder: u }) }),
19
19
  /* @__PURE__ */ t(B, { children: o.map((e) => {
20
- const l = n && S, p = String(l ? e[S] : e.value), g = l ? String(e[n]) : e.label, s = l && a ? String(e[a]) : null, f = l ? (c == null ? void 0 : c(e)) ?? !1 : e.disabled;
21
- return /* @__PURE__ */ t(j, { value: p, disabled: f, children: /* @__PURE__ */ r("span", { className: "flex flex-col", children: [
22
- /* @__PURE__ */ t("span", { children: g }),
23
- s && /* @__PURE__ */ r("span", { className: "text-xs text-muted-foreground text-d-tertiary", children: [
20
+ const l = n && S, p = String(l ? e[S] : e.value), f = l ? String(e[n]) : e.label, s = l && a ? String(e[a]) : null, g = l ? (c == null ? void 0 : c(e)) ?? !1 : e.disabled;
21
+ return /* @__PURE__ */ t(w, { value: p, disabled: g, children: /* @__PURE__ */ r("span", { className: "flex flex-col", children: [
22
+ /* @__PURE__ */ t("span", { children: f }),
23
+ s && /* @__PURE__ */ r("span", { className: "text-muted-foreground text-d-tertiary text-xs", children: [
24
24
  "- ",
25
25
  s
26
26
  ] })
@@ -29,10 +29,10 @@ function I({
29
29
  ] });
30
30
  }
31
31
  export {
32
- I as AppSelect,
32
+ G as AppSelect,
33
33
  B as AppSelectContent,
34
34
  T as AppSelectGroup,
35
- j as AppSelectItem,
35
+ w as AppSelectItem,
36
36
  U as AppSelectLabel,
37
37
  V as AppSelectScrollDownButton,
38
38
  b as AppSelectScrollUpButton,
@@ -1,25 +1,26 @@
1
1
  "use client";
2
2
  import { jsxs as i, jsx as e } from "react/jsx-runtime";
3
- import * as d from "react";
3
+ import * as c from "react";
4
4
  import { Root as p, Group as f, Value as g, Trigger as x, Icon as h, Portal as v, Content as b, Viewport as y, Label as S, Item as w, ItemIndicator as z, ItemText as N, Separator as C, ScrollUpButton as I, ScrollDownButton as _ } from "../../node_modules/@radix-ui/react-select/dist/index.js";
5
5
  import { cn as o } from "../../lib/utils.js";
6
6
  import { Label as j } from "./label.js";
7
- import c from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
7
+ import u from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
8
8
  import k from "../../node_modules/lucide-react/dist/esm/icons/check.js";
9
9
  import B from "../../node_modules/lucide-react/dist/esm/icons/chevron-up.js";
10
10
  function q({
11
11
  size: t = "default",
12
12
  label: a,
13
- labelClassName: s,
14
- ...r
13
+ className: s,
14
+ labelClassName: r,
15
+ ...d
15
16
  }) {
16
- const n = d.useId();
17
- return /* @__PURE__ */ i("div", { className: "space-y-1.5", children: [
18
- a && /* @__PURE__ */ e(j, { htmlFor: n, className: s, children: a }),
19
- /* @__PURE__ */ e(u.Provider, { value: { size: t, id: n }, children: /* @__PURE__ */ e(p, { "data-slot": "select", ...r }) })
17
+ const n = c.useId();
18
+ return /* @__PURE__ */ i("div", { className: o("space-y-1.5", s), children: [
19
+ a && /* @__PURE__ */ e(j, { htmlFor: n, className: r, children: a }),
20
+ /* @__PURE__ */ e(m.Provider, { value: { size: t, id: n }, children: /* @__PURE__ */ e(p, { "data-slot": "select", ...d }) })
20
21
  ] });
21
22
  }
22
- const u = d.createContext({ size: "default" }), L = () => d.useContext(u);
23
+ const m = c.createContext({ size: "default" }), L = () => c.useContext(m);
23
24
  function A({
24
25
  ...t
25
26
  }) {
@@ -36,11 +37,11 @@ function H({
36
37
  children: s,
37
38
  ...r
38
39
  }) {
39
- const { size: n, id: m } = L(), l = a || n;
40
+ const { size: d, id: n } = L(), l = a || d;
40
41
  return /* @__PURE__ */ i(
41
42
  x,
42
43
  {
43
- id: m,
44
+ id: n,
44
45
  "data-slot": "select-trigger",
45
46
  "data-size": l,
46
47
  className: o(
@@ -56,7 +57,7 @@ function H({
56
57
  ...r,
57
58
  children: [
58
59
  s,
59
- /* @__PURE__ */ e(h, { asChild: !0, children: /* @__PURE__ */ e(c, { className: "size-4 opacity-50" }) })
60
+ /* @__PURE__ */ e(h, { asChild: !0, children: /* @__PURE__ */ e(u, { className: "size-4 opacity-50" }) })
60
61
  ]
61
62
  }
62
63
  );
@@ -175,7 +176,7 @@ function R({
175
176
  t
176
177
  ),
177
178
  ...a,
178
- children: /* @__PURE__ */ e(c, { className: "size-4" })
179
+ children: /* @__PURE__ */ e(u, { className: "size-4" })
179
180
  }
180
181
  );
181
182
  }
package/dist/index.d.ts CHANGED
@@ -1358,7 +1358,7 @@ export declare function ScrollArea({ className, children, ...props }: React_2.Co
1358
1358
 
1359
1359
  export declare function ScrollBar({ className, orientation, ...props }: React_2.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>): JSX.Element;
1360
1360
 
1361
- export declare function Select({ size, label, labelClassName, ...props }: SelectProps): JSX.Element;
1361
+ export declare function Select({ size, label, className, labelClassName, ...props }: SelectProps): JSX.Element;
1362
1362
 
1363
1363
  export declare function SelectContent({ className, children, position, ...props }: React_2.ComponentProps<typeof SelectPrimitive.Content>): JSX.Element;
1364
1364
 
@@ -1371,6 +1371,7 @@ export declare function SelectLabel({ className, ...props }: React_2.ComponentPr
1371
1371
  declare interface SelectProps extends React_2.ComponentProps<typeof SelectPrimitive.Root> {
1372
1372
  size?: SelectSizeType;
1373
1373
  label?: string | React_2.ReactNode;
1374
+ className?: string;
1374
1375
  labelClassName?: string;
1375
1376
  }
1376
1377
 
@@ -3,7 +3,7 @@ import { stringify as w } from "../../comma-separated-tokens/index.js";
3
3
  import { ok as u } from "../../devlop/lib/default.js";
4
4
  import { svg as m, html as C } from "../../property-information/index.js";
5
5
  import { stringify as N } from "../../space-separated-tokens/index.js";
6
- import S from "../../../_virtual/index4.js";
6
+ import S from "../../../_virtual/index5.js";
7
7
  import { whitespace as j } from "../../hast-util-whitespace/lib/index.js";
8
8
  import { name as x } from "../../estree-util-is-identifier-name/lib/index.js";
9
9
  import { VFileMessage as h } from "../../vfile-message/lib/index.js";
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { __module as e } from "../../_virtual/index6.js";
2
+ import { __module as e } from "../../_virtual/index4.js";
3
3
  import { __require as t } from "./cjs/react-is.production.min.js";
4
4
  import { __require as o } from "./cjs/react-is.development.js";
5
5
  var r;
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { bail as P } from "../../bail/index.js";
3
- import y from "../../../_virtual/index5.js";
3
+ import y from "../../../_virtual/index6.js";
4
4
  import z from "../../is-plain-obj/index.js";
5
5
  import { CallableInstance as C } from "./callable-instance.js";
6
6
  import { trough as A } from "../../trough/lib/index.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "laif-ds",
3
3
  "private": false,
4
- "version": "0.1.59",
4
+ "version": "0.1.61",
5
5
  "type": "module",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",