@oneplatformdev/ui 0.1.99-beta.6 → 0.1.99-beta.7

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.
@@ -11,6 +11,10 @@ export interface ButtonDefaultProps extends Omit<ButtonAttributes, 'color' | 'ti
11
11
  asChild?: boolean;
12
12
  loading?: boolean;
13
13
  disabled?: boolean;
14
+ /**
15
+ * Screen reader text or options used for accessibility (e.g., when the button is loading).
16
+ * Accepts a string or an object with a `text` property for more control.
17
+ */
14
18
  screenReader?: ButtonScreenReader;
15
19
  }
16
20
  export interface ButtonTooltipProps {
@@ -1 +1 @@
1
- {"version":3,"file":"Button.types.d.ts","sourceRoot":"","sources":["../../src/Button/Button.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACnF,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,KAAK,gBAAgB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAEhE,KAAK,yBAAyB,GAAG;IAC/B,+EAA+E;IAC/E,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAA;AACD,MAAM,MAAM,kBAAkB,GAAG,yBAAyB,CAAC,MAAM,CAAC,GAAG,yBAAyB,CAAA;AAE9F,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,OAAO,GAAG,UAAU,CAAC;IAC9D,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,kBAAkB,CAAC;CACnC;AAED,MAAM,WAAW,kBAAkB;IAC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 🚀 Features
4
+
5
+ - **Button:** add screen reader support for accessibility ([ec7de8e](https://github.com/oneplatformdev/core-web/commit/ec7de8e))
6
+
7
+ ### 🧱 Updated Dependencies
8
+
9
+ - Updated @oneplatformdev/utils to 0.1.99-beta.7
10
+ - Updated @oneplatformdev/hooks to 0.1.99-beta.7
11
+ - Updated @oneplatformdev/tokens to 0.1.99-beta.7
12
+
13
+ ### ❤️ Thank You
14
+
15
+ - Bohdan Radchenko
16
+
1
17
  ## 0.1.99-beta.6 (2025-12-29)
2
18
 
3
19
  ### 🚀 Features
@@ -1,4 +1,4 @@
1
- import { jsxs as l, Fragment as g, jsx as b } from "react/jsx-runtime";
1
+ import { jsxs as l, Fragment as p, jsx as b } from "react/jsx-runtime";
2
2
  import * as h from "react";
3
3
  import { useId as A, useRef as v, useState as w, useImperativeHandle as z, useEffect as F } from "react";
4
4
  import { cn as d } from "@oneplatformdev/utils";
@@ -9,12 +9,12 @@ const y = h.forwardRef(
9
9
  className: c,
10
10
  value: t = "",
11
11
  maxHeight: o = Number.MAX_SAFE_INTEGER,
12
- minHeight: i = 0,
12
+ minHeight: i = 40,
13
13
  resizeble: f = !0,
14
14
  counter: s = !1,
15
15
  id: n = "",
16
16
  ...r
17
- } = u, a = A(), e = v(null), [x, p] = w("");
17
+ } = u, a = A(), e = v(null), [x, g] = w("");
18
18
  return N({
19
19
  textAreaRef: e,
20
20
  triggerAutoSize: x,
@@ -27,8 +27,8 @@ const y = h.forwardRef(
27
27
  maxHeight: o,
28
28
  minHeight: i
29
29
  })), F(() => {
30
- p(t);
31
- }, [r?.defaultValue, t]), /* @__PURE__ */ l(g, { children: [
30
+ g(t);
31
+ }, [r?.defaultValue, t]), /* @__PURE__ */ l(p, { children: [
32
32
  /* @__PURE__ */ b(
33
33
  "textarea",
34
34
  {
@@ -38,7 +38,7 @@ const y = h.forwardRef(
38
38
  value: t,
39
39
  className: d(
40
40
  "flex min-h-10 w-full px-3 py-2 text-base relative md:text-sm",
41
- "rounded-[12px] border border-input bg-[#FCFCFC] shadow-none",
41
+ "rounded-lg border border-input bg-[#FCFCFC] shadow-none",
42
42
  "placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
43
43
  "focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring",
44
44
  f ? "resize" : "resize-none overflow-hidden!",
@@ -1 +1 @@
1
- {"version":3,"file":"Textarea.js","sources":["../../src/Textarea/Textarea.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useEffect, useId, useImperativeHandle, useRef, useState } from 'react';\nimport { cn } from '@oneplatformdev/utils';\n\nimport { TextareaProps } from './Textarea.types';\nimport { useAutosizeTextArea } from './useAutosizeTextArea';\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n (textareaProps, ref) => {\n const {\n className,\n value = '',\n maxHeight = Number.MAX_SAFE_INTEGER,\n minHeight = 0,\n resizeble = true,\n counter = false,\n id: customId = '',\n ...props\n } = textareaProps;\n const id = useId();\n const textAreaRef = useRef<HTMLTextAreaElement | null>(null);\n const [triggerAutoSize, setTriggerAutoSize] = useState('');\n\n useAutosizeTextArea({\n textAreaRef,\n triggerAutoSize: triggerAutoSize,\n maxHeight,\n minHeight,\n });\n\n useImperativeHandle(ref, () => ({\n ...((textAreaRef.current ?? {}) as HTMLTextAreaElement),\n textArea: textAreaRef.current as HTMLTextAreaElement,\n focus: () => textAreaRef?.current?.focus(),\n maxHeight,\n minHeight,\n }));\n\n useEffect(() => {\n setTriggerAutoSize(value as string);\n }, [props?.defaultValue, value]);\n\n return (\n <>\n <textarea\n id={customId || id}\n {...props}\n ref={textAreaRef}\n value={value}\n className={cn(\n 'flex min-h-10 w-full px-3 py-2 text-base relative md:text-sm',\n 'rounded-[12px] border border-input bg-[#FCFCFC] shadow-none',\n 'placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50',\n 'focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring',\n resizeble ? 'resize' : 'resize-none overflow-hidden!',\n counter && 'pb-2',\n className\n )}\n />\n {counter && (\n <label\n htmlFor={customId || id}\n className={cn(\n 'w-full text-right inline-flex items-center justify-end',\n 'text-sm font-normal text-muted-foreground',\n 'leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70'\n )}\n >\n {String(value || '').length} / {props?.maxLength}\n </label>\n )}\n </>\n );\n }\n);\nTextarea.displayName = 'Textarea';\n\nexport { Textarea };\n"],"names":["Textarea","React","textareaProps","ref","className","value","maxHeight","minHeight","resizeble","counter","customId","props","id","useId","textAreaRef","useRef","triggerAutoSize","setTriggerAutoSize","useState","useAutosizeTextArea","useImperativeHandle","useEffect","jsxs","Fragment","jsx","cn"],"mappings":";;;;;AAOA,MAAMA,IAAWC,EAAM;AAAA,EACrB,CAACC,GAAeC,MAAQ;AACtB,UAAM;AAAA,MACJ,WAAAC;AAAA,MACA,OAAAC,IAAQ;AAAA,MACR,WAAAC,IAAY,OAAO;AAAA,MACnB,WAAAC,IAAY;AAAA,MACZ,WAAAC,IAAY;AAAA,MACZ,SAAAC,IAAU;AAAA,MACV,IAAIC,IAAW;AAAA,MACf,GAAGC;AAAA,IAAA,IACDT,GACEU,IAAKC,EAAA,GACLC,IAAcC,EAAmC,IAAI,GACrD,CAACC,GAAiBC,CAAkB,IAAIC,EAAS,EAAE;AAEzD,WAAAC,EAAoB;AAAA,MAClB,aAAAL;AAAA,MACA,iBAAAE;AAAA,MACA,WAAAV;AAAA,MACA,WAAAC;AAAA,IAAA,CACD,GAEDa,EAAoBjB,GAAK,OAAO;AAAA,MAC9B,GAAKW,EAAY,WAAW,CAAA;AAAA,MAC5B,UAAUA,EAAY;AAAA,MACtB,OAAO,MAAMA,GAAa,SAAS,MAAA;AAAA,MACnC,WAAAR;AAAA,MACA,WAAAC;AAAA,IAAA,EACA,GAEFc,EAAU,MAAM;AACd,MAAAJ,EAAmBZ,CAAe;AAAA,IACpC,GAAG,CAACM,GAAO,cAAcN,CAAK,CAAC,GAG7B,gBAAAiB,EAAAC,GAAA,EACE,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,IAAId,KAAYE;AAAA,UACf,GAAGD;AAAA,UACJ,KAAKG;AAAA,UACL,OAAAT;AAAA,UACA,WAAWoB;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACAjB,IAAY,WAAW;AAAA,YACvBC,KAAW;AAAA,YACXL;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,MAEDK,KACC,gBAAAa;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,SAASZ,KAAYE;AAAA,UACrB,WAAWa;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,UAAA;AAAA,UAGD,UAAA;AAAA,YAAA,OAAOpB,KAAS,EAAE,EAAE;AAAA,YAAO;AAAA,YAAIM,GAAO;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACzC,GAEJ;AAAA,EAEJ;AACF;AACAX,EAAS,cAAc;"}
1
+ {"version":3,"file":"Textarea.js","sources":["../../src/Textarea/Textarea.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useEffect, useId, useImperativeHandle, useRef, useState } from 'react';\nimport { cn } from '@oneplatformdev/utils';\n\nimport { TextareaProps } from './Textarea.types';\nimport { useAutosizeTextArea } from './useAutosizeTextArea';\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n (textareaProps, ref) => {\n const {\n className,\n value = '',\n maxHeight = Number.MAX_SAFE_INTEGER,\n minHeight = 40,\n resizeble = true,\n counter = false,\n id: customId = '',\n ...props\n } = textareaProps;\n const id = useId();\n const textAreaRef = useRef<HTMLTextAreaElement | null>(null);\n const [triggerAutoSize, setTriggerAutoSize] = useState('');\n\n useAutosizeTextArea({\n textAreaRef,\n triggerAutoSize: triggerAutoSize,\n maxHeight,\n minHeight,\n });\n\n useImperativeHandle(ref, () => ({\n ...((textAreaRef.current ?? {}) as HTMLTextAreaElement),\n textArea: textAreaRef.current as HTMLTextAreaElement,\n focus: () => textAreaRef?.current?.focus(),\n maxHeight,\n minHeight,\n }));\n\n useEffect(() => {\n setTriggerAutoSize(value as string);\n }, [props?.defaultValue, value]);\n\n return (\n <>\n <textarea\n id={customId || id}\n {...props}\n ref={textAreaRef}\n value={value}\n className={cn(\n 'flex min-h-10 w-full px-3 py-2 text-base relative md:text-sm',\n 'rounded-lg border border-input bg-[#FCFCFC] shadow-none',\n 'placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50',\n 'focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring',\n resizeble ? 'resize' : 'resize-none overflow-hidden!',\n counter && 'pb-2',\n className\n )}\n />\n {counter && (\n <label\n htmlFor={customId || id}\n className={cn(\n 'w-full text-right inline-flex items-center justify-end',\n 'text-sm font-normal text-muted-foreground',\n 'leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70'\n )}\n >\n {String(value || '').length} / {props?.maxLength}\n </label>\n )}\n </>\n );\n }\n);\nTextarea.displayName = 'Textarea';\n\nexport { Textarea };\n"],"names":["Textarea","React","textareaProps","ref","className","value","maxHeight","minHeight","resizeble","counter","customId","props","id","useId","textAreaRef","useRef","triggerAutoSize","setTriggerAutoSize","useState","useAutosizeTextArea","useImperativeHandle","useEffect","jsxs","Fragment","jsx","cn"],"mappings":";;;;;AAOA,MAAMA,IAAWC,EAAM;AAAA,EACrB,CAACC,GAAeC,MAAQ;AACtB,UAAM;AAAA,MACJ,WAAAC;AAAA,MACA,OAAAC,IAAQ;AAAA,MACR,WAAAC,IAAY,OAAO;AAAA,MACnB,WAAAC,IAAY;AAAA,MACZ,WAAAC,IAAY;AAAA,MACZ,SAAAC,IAAU;AAAA,MACV,IAAIC,IAAW;AAAA,MACf,GAAGC;AAAA,IAAA,IACDT,GACEU,IAAKC,EAAA,GACLC,IAAcC,EAAmC,IAAI,GACrD,CAACC,GAAiBC,CAAkB,IAAIC,EAAS,EAAE;AAEzD,WAAAC,EAAoB;AAAA,MAClB,aAAAL;AAAA,MACA,iBAAAE;AAAA,MACA,WAAAV;AAAA,MACA,WAAAC;AAAA,IAAA,CACD,GAEDa,EAAoBjB,GAAK,OAAO;AAAA,MAC9B,GAAKW,EAAY,WAAW,CAAA;AAAA,MAC5B,UAAUA,EAAY;AAAA,MACtB,OAAO,MAAMA,GAAa,SAAS,MAAA;AAAA,MACnC,WAAAR;AAAA,MACA,WAAAC;AAAA,IAAA,EACA,GAEFc,EAAU,MAAM;AACd,MAAAJ,EAAmBZ,CAAe;AAAA,IACpC,GAAG,CAACM,GAAO,cAAcN,CAAK,CAAC,GAG7B,gBAAAiB,EAAAC,GAAA,EACE,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,IAAId,KAAYE;AAAA,UACf,GAAGD;AAAA,UACJ,KAAKG;AAAA,UACL,OAAAT;AAAA,UACA,WAAWoB;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACAjB,IAAY,WAAW;AAAA,YACvBC,KAAW;AAAA,YACXL;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,MAEDK,KACC,gBAAAa;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,SAASZ,KAAYE;AAAA,UACrB,WAAWa;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,UAAA;AAAA,UAGD,UAAA;AAAA,YAAA,OAAOpB,KAAS,EAAE,EAAE;AAAA,YAAO;AAAA,YAAIM,GAAO;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACzC,GAEJ;AAAA,EAEJ;AACF;AACAX,EAAS,cAAc;"}
@@ -0,0 +1,12 @@
1
+ import { Textarea as t } from "./Textarea.js";
2
+ const a = {
3
+ title: "Textarea",
4
+ component: t
5
+ }, o = {
6
+ args: {}
7
+ };
8
+ export {
9
+ o as Default,
10
+ a as default
11
+ };
12
+ //# sourceMappingURL=Textarea.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Textarea.stories.js","sources":["../../src/Textarea/Textarea.stories.tsx"],"sourcesContent":["import type { Meta, StoryObj } from '@storybook/react-vite';\n\nimport { Textarea } from './Textarea';\n\nconst meta = {\n title: 'Textarea',\n component: Textarea,\n} satisfies Meta<typeof Textarea>;\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const Default: Story = {\n args: {}\n};\n"],"names":["meta","Textarea","Default"],"mappings":";AAIA,MAAMA,IAAO;AAAA,EACX,OAAO;AAAA,EACP,WAAWC;AACb,GAMaC,IAAiB;AAAA,EAC5B,MAAM,CAAA;AACR;"}
@@ -1,3 +1,3 @@
1
- import { IUseAutosizeTextAreaProps } from '../../projects/ui/src/index.ts';
1
+ import { IUseAutosizeTextAreaProps } from './Textarea.types';
2
2
  export declare const useAutosizeTextArea: ({ textAreaRef, triggerAutoSize, maxHeight, minHeight, }: IUseAutosizeTextAreaProps) => void;
3
3
  //# sourceMappingURL=useAutosizeTextArea.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAutosizeTextArea.d.ts","sourceRoot":"","sources":["../../src/Textarea/useAutosizeTextArea.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,eAAO,MAAM,mBAAmB,GAAI,yDAKjC,yBAAyB,SAsB3B,CAAC"}
1
+ {"version":3,"file":"useAutosizeTextArea.d.ts","sourceRoot":"","sources":["../../src/Textarea/useAutosizeTextArea.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAE7D,eAAO,MAAM,mBAAmB,GAAI,yDAKjC,yBAAyB,SAsB3B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useAutosizeTextArea.js","sources":["../../src/Textarea/useAutosizeTextArea.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { IUseAutosizeTextAreaProps } from '@oneplatformdev/ui';\n\nexport const useAutosizeTextArea = ({\n textAreaRef,\n triggerAutoSize,\n maxHeight = Number.MAX_SAFE_INTEGER,\n minHeight = 0,\n}: IUseAutosizeTextAreaProps) => {\n const [init, setInit] = React.useState(true);\n React.useEffect(() => {\n const offsetBorder = 0;\n const textAreaElement = textAreaRef.current;\n if (textAreaElement) {\n if (init) {\n textAreaElement.style.minHeight = `${minHeight + offsetBorder}px`;\n if (maxHeight > minHeight) {\n textAreaElement.style.maxHeight = `${maxHeight}px`;\n }\n setInit(false);\n }\n textAreaElement.style.height = `${minHeight + offsetBorder}px`;\n const scrollHeight = textAreaElement.scrollHeight;\n if (scrollHeight > maxHeight) {\n textAreaElement.style.height = `${maxHeight}px`;\n } else {\n textAreaElement.style.height = `${scrollHeight + offsetBorder}px`;\n }\n }\n }, [textAreaRef.current, triggerAutoSize]);\n};\n"],"names":["useAutosizeTextArea","textAreaRef","triggerAutoSize","maxHeight","minHeight","init","setInit","React","textAreaElement","scrollHeight"],"mappings":";AAKO,MAAMA,IAAsB,CAAC;AAAA,EAClC,aAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,WAAAC,IAAY,OAAO;AAAA,EACnB,WAAAC,IAAY;AACd,MAAiC;AAC/B,QAAM,CAACC,GAAMC,CAAO,IAAIC,EAAM,SAAS,EAAI;AAC3C,EAAAA,EAAM,UAAU,MAAM;AAEpB,UAAMC,IAAkBP,EAAY;AACpC,QAAIO,GAAiB;AACnB,MAAIH,MACFG,EAAgB,MAAM,YAAY,GAAGJ,IAAY,CAAY,MACzDD,IAAYC,MACdI,EAAgB,MAAM,YAAY,GAAGL,CAAS,OAEhDG,EAAQ,EAAK,IAEfE,EAAgB,MAAM,SAAS,GAAGJ,IAAY,CAAY;AAC1D,YAAMK,IAAeD,EAAgB;AACrC,MAAIC,IAAeN,IACjBK,EAAgB,MAAM,SAAS,GAAGL,CAAS,OAE3CK,EAAgB,MAAM,SAAS,GAAGC,IAAe,CAAY;AAAA,IAEjE;AAAA,EACF,GAAG,CAACR,EAAY,SAASC,CAAe,CAAC;AAC3C;"}
1
+ {"version":3,"file":"useAutosizeTextArea.js","sources":["../../src/Textarea/useAutosizeTextArea.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { IUseAutosizeTextAreaProps } from './Textarea.types';\n\nexport const useAutosizeTextArea = ({\n textAreaRef,\n triggerAutoSize,\n maxHeight = Number.MAX_SAFE_INTEGER,\n minHeight = 0,\n}: IUseAutosizeTextAreaProps) => {\n const [init, setInit] = React.useState(true);\n React.useEffect(() => {\n const offsetBorder = 0;\n const textAreaElement = textAreaRef.current;\n if (textAreaElement) {\n if (init) {\n textAreaElement.style.minHeight = `${minHeight + offsetBorder}px`;\n if (maxHeight > minHeight) {\n textAreaElement.style.maxHeight = `${maxHeight}px`;\n }\n setInit(false);\n }\n textAreaElement.style.height = `${minHeight + offsetBorder}px`;\n const scrollHeight = textAreaElement.scrollHeight;\n if (scrollHeight > maxHeight) {\n textAreaElement.style.height = `${maxHeight}px`;\n } else {\n textAreaElement.style.height = `${scrollHeight + offsetBorder}px`;\n }\n }\n }, [textAreaRef.current, triggerAutoSize]);\n};\n"],"names":["useAutosizeTextArea","textAreaRef","triggerAutoSize","maxHeight","minHeight","init","setInit","React","textAreaElement","scrollHeight"],"mappings":";AAKO,MAAMA,IAAsB,CAAC;AAAA,EAClC,aAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,WAAAC,IAAY,OAAO;AAAA,EACnB,WAAAC,IAAY;AACd,MAAiC;AAC/B,QAAM,CAACC,GAAMC,CAAO,IAAIC,EAAM,SAAS,EAAI;AAC3C,EAAAA,EAAM,UAAU,MAAM;AAEpB,UAAMC,IAAkBP,EAAY;AACpC,QAAIO,GAAiB;AACnB,MAAIH,MACFG,EAAgB,MAAM,YAAY,GAAGJ,IAAY,CAAY,MACzDD,IAAYC,MACdI,EAAgB,MAAM,YAAY,GAAGL,CAAS,OAEhDG,EAAQ,EAAK,IAEfE,EAAgB,MAAM,SAAS,GAAGJ,IAAY,CAAY;AAC1D,YAAMK,IAAeD,EAAgB;AACrC,MAAIC,IAAeN,IACjBK,EAAgB,MAAM,SAAS,GAAGL,CAAS,OAE3CK,EAAgB,MAAM,SAAS,GAAGC,IAAe,CAAY;AAAA,IAEjE;AAAA,EACF,GAAG,CAACR,EAAY,SAASC,CAAe,CAAC;AAC3C;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneplatformdev/ui",
3
- "version": "0.1.99-beta.6",
3
+ "version": "0.1.99-beta.7",
4
4
  "description": "UI component library for OnePlatform",
5
5
  "author": "One Platform Development Team",
6
6
  "keywords": [
@@ -105,9 +105,9 @@
105
105
  "recharts": "^3.2.0",
106
106
  "sonner": "^2.0.7",
107
107
  "vaul": "^1.1.2",
108
- "@oneplatformdev/hooks": "^0.1.99-beta.6",
109
- "@oneplatformdev/tokens": "^0.1.99-beta.6",
110
- "@oneplatformdev/utils": "^0.1.99-beta.6"
108
+ "@oneplatformdev/tokens": "^0.1.99-beta.7",
109
+ "@oneplatformdev/hooks": "^0.1.99-beta.7",
110
+ "@oneplatformdev/utils": "^0.1.99-beta.7"
111
111
  },
112
112
  "scripts": {
113
113
  "chromatic": "chromatic"