@dashx/react 0.1.1 → 0.1.3
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/dist/cjs/components/button.d.ts +2 -1
- package/dist/cjs/components/button.js +1 -1
- package/dist/cjs/components/button.js.map +3 -3
- package/dist/cjs/components/card.js +1 -1
- package/dist/cjs/components/card.js.map +2 -2
- package/dist/cjs/components/checkbox.d.ts +18 -0
- package/dist/cjs/components/checkbox.js +2 -0
- package/dist/cjs/components/checkbox.js.map +7 -0
- package/dist/cjs/components/flex.d.ts +321 -16
- package/dist/cjs/components/flex.js +1 -1
- package/dist/cjs/components/flex.js.map +3 -3
- package/dist/cjs/components/form.d.ts +11 -0
- package/dist/cjs/components/form.js +2 -0
- package/dist/cjs/components/form.js.map +7 -0
- package/dist/cjs/components/index.d.ts +5 -0
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/index.js.map +2 -2
- package/dist/cjs/components/link.d.ts +10 -0
- package/dist/cjs/components/link.js +2 -0
- package/dist/cjs/components/link.js.map +7 -0
- package/dist/cjs/components/number-field.d.ts +11 -0
- package/dist/cjs/components/number-field.js +2 -0
- package/dist/cjs/components/number-field.js.map +7 -0
- package/dist/cjs/components/popover.d.ts +6 -6
- package/dist/cjs/components/text-area.d.ts +11 -0
- package/dist/cjs/components/text-area.js +2 -0
- package/dist/cjs/components/text-area.js.map +7 -0
- package/dist/cjs/components/text-field.d.ts +10 -1
- package/dist/cjs/components/text-field.js +1 -1
- package/dist/cjs/components/text-field.js.map +3 -3
- package/dist/cjs/components/text.d.ts +1 -1
- package/dist/cjs/components/text.js +1 -1
- package/dist/cjs/components/text.js.map +3 -3
- package/dist/cjs/components/theme.d.ts +2 -0
- package/dist/cjs/components/theme.js +1 -1
- package/dist/cjs/components/theme.js.map +3 -3
- package/dist/cjs/components/tooltip.js +1 -1
- package/dist/cjs/components/tooltip.js.map +2 -2
- package/dist/cjs/hooks/index.d.ts +1 -0
- package/dist/cjs/hooks/index.js +1 -1
- package/dist/cjs/hooks/index.js.map +3 -3
- package/dist/cjs/hooks/use-in-app.js +1 -1
- package/dist/cjs/hooks/use-in-app.js.map +3 -3
- package/dist/cjs/hooks/use-product-release.d.ts +6 -0
- package/dist/cjs/hooks/use-product-release.js +2 -0
- package/dist/cjs/hooks/use-product-release.js.map +7 -0
- package/dist/cjs/providers/DashXProvider.d.ts +7 -2
- package/dist/cjs/providers/DashXProvider.js +1 -1
- package/dist/cjs/providers/DashXProvider.js.map +3 -3
- package/dist/cjs/providers/index.d.ts +1 -1
- package/dist/cjs/providers/index.js +1 -1
- package/dist/cjs/providers/index.js.map +2 -2
- package/dist/cjs/utils/helpers.d.ts +2 -0
- package/dist/cjs/utils/helpers.js +2 -0
- package/dist/cjs/utils/helpers.js.map +7 -0
- package/dist/cjs/variants/base-element.d.ts +91 -0
- package/dist/cjs/variants/base-element.js +1 -1
- package/dist/cjs/variants/base-element.js.map +2 -2
- package/dist/cjs/variants/base-field.d.ts +236 -0
- package/dist/cjs/variants/base-field.js +2 -0
- package/dist/cjs/variants/base-field.js.map +7 -0
- package/dist/cjs/variants/base-input.d.ts +5 -0
- package/dist/cjs/variants/base-input.js +2 -0
- package/dist/cjs/variants/base-input.js.map +7 -0
- package/dist/cjs/variants/button.d.ts +122 -15
- package/dist/cjs/variants/button.js +1 -1
- package/dist/cjs/variants/button.js.map +2 -2
- package/dist/cjs/variants/card.d.ts +2 -2
- package/dist/cjs/variants/card.js +1 -1
- package/dist/cjs/variants/card.js.map +2 -2
- package/dist/cjs/variants/checkbox.d.ts +41 -0
- package/dist/cjs/variants/checkbox.js +2 -0
- package/dist/cjs/variants/checkbox.js.map +7 -0
- package/dist/cjs/variants/field-error.d.ts +149 -0
- package/dist/cjs/variants/field-error.js +2 -0
- package/dist/cjs/variants/field-error.js.map +7 -0
- package/dist/cjs/variants/heading.d.ts +45 -0
- package/dist/cjs/variants/index.d.ts +2 -0
- package/dist/cjs/variants/index.js +1 -1
- package/dist/cjs/variants/index.js.map +2 -2
- package/dist/cjs/variants/link.d.ts +470 -0
- package/dist/cjs/variants/link.js +2 -0
- package/dist/cjs/variants/link.js.map +7 -0
- package/dist/cjs/variants/popover.d.ts +4 -4
- package/dist/cjs/variants/popover.js +1 -1
- package/dist/cjs/variants/popover.js.map +2 -2
- package/dist/cjs/variants/text-area.d.ts +298 -0
- package/dist/cjs/variants/text-area.js +2 -0
- package/dist/cjs/variants/text-area.js.map +7 -0
- package/dist/cjs/variants/text-field.d.ts +218 -13
- package/dist/cjs/variants/text-field.js +1 -1
- package/dist/cjs/variants/text-field.js.map +3 -3
- package/dist/cjs/variants/text.d.ts +48 -1
- package/dist/cjs/variants/text.js +1 -1
- package/dist/cjs/variants/text.js.map +2 -2
- package/dist/cjs/variants/tooltip.d.ts +1 -1
- package/dist/cjs/variants/tooltip.js +1 -1
- package/dist/cjs/variants/tooltip.js.map +2 -2
- package/dist/cjs/variants/typography.d.ts +35 -0
- package/dist/cjs/variants/typography.js +1 -1
- package/dist/cjs/variants/typography.js.map +2 -2
- package/dist/esm/components/button.d.ts +2 -1
- package/dist/esm/components/button.js +1 -1
- package/dist/esm/components/button.js.map +3 -3
- package/dist/esm/components/card.js +1 -1
- package/dist/esm/components/card.js.map +2 -2
- package/dist/esm/components/checkbox.d.ts +18 -0
- package/dist/esm/components/checkbox.js +2 -0
- package/dist/esm/components/checkbox.js.map +7 -0
- package/dist/esm/components/flex.d.ts +321 -16
- package/dist/esm/components/flex.js +1 -1
- package/dist/esm/components/flex.js.map +3 -3
- package/dist/esm/components/form.d.ts +11 -0
- package/dist/esm/components/form.js +2 -0
- package/dist/esm/components/form.js.map +7 -0
- package/dist/esm/components/index.d.ts +5 -0
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +2 -2
- package/dist/esm/components/link.d.ts +10 -0
- package/dist/esm/components/link.js +2 -0
- package/dist/esm/components/link.js.map +7 -0
- package/dist/esm/components/number-field.d.ts +11 -0
- package/dist/esm/components/number-field.js +2 -0
- package/dist/esm/components/number-field.js.map +7 -0
- package/dist/esm/components/popover.d.ts +6 -6
- package/dist/esm/components/text-area.d.ts +11 -0
- package/dist/esm/components/text-area.js +2 -0
- package/dist/esm/components/text-area.js.map +7 -0
- package/dist/esm/components/text-field.d.ts +10 -1
- package/dist/esm/components/text-field.js +1 -1
- package/dist/esm/components/text-field.js.map +3 -3
- package/dist/esm/components/text.d.ts +1 -1
- package/dist/esm/components/text.js +1 -1
- package/dist/esm/components/text.js.map +3 -3
- package/dist/esm/components/theme.d.ts +2 -0
- package/dist/esm/components/theme.js +1 -1
- package/dist/esm/components/theme.js.map +3 -3
- package/dist/esm/components/tooltip.js +1 -1
- package/dist/esm/components/tooltip.js.map +2 -2
- package/dist/esm/hooks/index.d.ts +1 -0
- package/dist/esm/hooks/index.js +1 -1
- package/dist/esm/hooks/index.js.map +2 -2
- package/dist/esm/hooks/use-in-app.js +1 -1
- package/dist/esm/hooks/use-in-app.js.map +3 -3
- package/dist/esm/hooks/use-product-release.d.ts +6 -0
- package/dist/esm/hooks/use-product-release.js +2 -0
- package/dist/esm/hooks/use-product-release.js.map +7 -0
- package/dist/esm/providers/DashXProvider.d.ts +7 -2
- package/dist/esm/providers/DashXProvider.js +1 -1
- package/dist/esm/providers/DashXProvider.js.map +3 -3
- package/dist/esm/providers/index.d.ts +1 -1
- package/dist/esm/providers/index.js +1 -1
- package/dist/esm/providers/index.js.map +3 -3
- package/dist/esm/utils/helpers.d.ts +2 -0
- package/dist/esm/utils/helpers.js +2 -0
- package/dist/esm/utils/helpers.js.map +7 -0
- package/dist/esm/variants/base-element.d.ts +91 -0
- package/dist/esm/variants/base-element.js +1 -1
- package/dist/esm/variants/base-element.js.map +2 -2
- package/dist/esm/variants/base-field.d.ts +236 -0
- package/dist/esm/variants/base-field.js +2 -0
- package/dist/esm/variants/base-field.js.map +7 -0
- package/dist/esm/variants/base-input.d.ts +5 -0
- package/dist/esm/variants/base-input.js +2 -0
- package/dist/esm/variants/base-input.js.map +7 -0
- package/dist/esm/variants/button.d.ts +122 -15
- package/dist/esm/variants/button.js +1 -1
- package/dist/esm/variants/button.js.map +2 -2
- package/dist/esm/variants/card.d.ts +2 -2
- package/dist/esm/variants/card.js +1 -1
- package/dist/esm/variants/card.js.map +2 -2
- package/dist/esm/variants/checkbox.d.ts +41 -0
- package/dist/esm/variants/checkbox.js +2 -0
- package/dist/esm/variants/checkbox.js.map +7 -0
- package/dist/esm/variants/field-error.d.ts +149 -0
- package/dist/esm/variants/field-error.js +2 -0
- package/dist/esm/variants/field-error.js.map +7 -0
- package/dist/esm/variants/heading.d.ts +45 -0
- package/dist/esm/variants/index.d.ts +2 -0
- package/dist/esm/variants/index.js +1 -1
- package/dist/esm/variants/index.js.map +2 -2
- package/dist/esm/variants/link.d.ts +470 -0
- package/dist/esm/variants/link.js +2 -0
- package/dist/esm/variants/link.js.map +7 -0
- package/dist/esm/variants/popover.d.ts +4 -4
- package/dist/esm/variants/popover.js +1 -1
- package/dist/esm/variants/popover.js.map +2 -2
- package/dist/esm/variants/text-area.d.ts +298 -0
- package/dist/esm/variants/text-area.js +2 -0
- package/dist/esm/variants/text-area.js.map +7 -0
- package/dist/esm/variants/text-field.d.ts +218 -13
- package/dist/esm/variants/text-field.js +1 -1
- package/dist/esm/variants/text-field.js.map +3 -3
- package/dist/esm/variants/text.d.ts +48 -1
- package/dist/esm/variants/text.js +1 -1
- package/dist/esm/variants/text.js.map +2 -2
- package/dist/esm/variants/tooltip.d.ts +1 -1
- package/dist/esm/variants/tooltip.js +1 -1
- package/dist/esm/variants/tooltip.js.map +2 -2
- package/dist/esm/variants/typography.d.ts +35 -0
- package/dist/esm/variants/typography.js +1 -1
- package/dist/esm/variants/typography.js.map +2 -2
- package/package.json +5 -6
- package/src/components/button.tsx +17 -21
- package/src/components/card.tsx +2 -2
- package/src/components/checkbox.tsx +255 -0
- package/src/components/flex.tsx +17 -7
- package/src/components/form.tsx +30 -0
- package/src/components/index.ts +5 -0
- package/src/components/link.tsx +90 -0
- package/src/components/number-field.tsx +174 -0
- package/src/components/text-area.tsx +107 -0
- package/src/components/text-field.tsx +103 -3
- package/src/components/text.tsx +13 -4
- package/src/components/theme.tsx +16 -4
- package/src/components/tooltip.tsx +1 -1
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-in-app.ts +17 -58
- package/src/hooks/use-product-release.ts +38 -0
- package/src/providers/DashXProvider.tsx +91 -5
- package/src/providers/index.ts +1 -1
- package/src/styles/index.css +180 -43
- package/src/utils/helpers.ts +21 -0
- package/src/variants/base-element.ts +18 -5
- package/src/variants/base-field.ts +42 -0
- package/src/variants/base-input.ts +13 -0
- package/src/variants/button.ts +47 -27
- package/src/variants/card.ts +3 -3
- package/src/variants/checkbox.ts +33 -0
- package/src/variants/field-error.ts +29 -0
- package/src/variants/index.ts +2 -0
- package/src/variants/link.ts +34 -0
- package/src/variants/popover.ts +5 -5
- package/src/variants/text-area.ts +26 -0
- package/src/variants/text-field.ts +14 -3
- package/src/variants/text.ts +2 -1
- package/src/variants/tooltip.ts +1 -1
- package/src/variants/typography.ts +14 -9
- package/styles.css +546 -124
- package/dist/cjs/tsconfig.tsbuildinfo +0 -1
- package/dist/esm/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FormProps as _FormProps } from '@react-types/form';
|
|
2
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
3
|
+
import type { DOMProps } from '@react-types/shared';
|
|
4
|
+
export interface FormProps extends _FormProps, DOMProps {
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: CSSProperties;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
noValidate?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const Form: import("react").ForwardRefExoticComponent<FormProps & import("react").RefAttributes<HTMLFormElement>>;
|
|
11
|
+
export { Form };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var c=(o,r)=>{for(var t in r)i(o,t,{get:r[t],enumerable:!0})},v=(o,r,t,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of F(r))!P.call(o,e)&&e!==t&&i(o,e,{get:()=>r[e],enumerable:!(a=f(r,e))||a.enumerable});return o};var x=o=>v(i({},"__esModule",{value:!0}),o);var C={};c(C,{Form:()=>p});module.exports=x(C);var m=require("react/jsx-runtime"),s=require("react-aria-components"),d=require("react-stately"),n=require("react");function y(o,r){let{validationErrors:t,children:a,className:e,...l}=o;return(0,m.jsx)("form",{...l,ref:r,className:e,children:(0,m.jsx)(s.FormContext.Provider,{value:{validationBehavior:o.noValidate?"aria":"native"},children:(0,m.jsx)(d.FormValidationContext.Provider,{value:t??{},children:a})})})}const p=(0,n.forwardRef)(y);
|
|
2
|
+
//# sourceMappingURL=form.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/form.tsx"],
|
|
4
|
+
"sourcesContent": ["import { FormContext } from 'react-aria-components';\nimport { FormValidationContext } from 'react-stately';\nimport { forwardRef } from 'react';\n\nimport type { FormProps as _FormProps } from '@react-types/form';\nimport type { CSSProperties, ForwardedRef, ReactNode } from 'react';\nimport type { DOMProps } from '@react-types/shared';\n\nexport interface FormProps extends _FormProps, DOMProps {\n className?: string;\n style?: CSSProperties;\n children?: ReactNode;\n noValidate?: boolean;\n}\n\nfunction _Form(props: FormProps, ref: ForwardedRef<HTMLFormElement>) {\n let { validationErrors, children, className, ...domProps } = props;\n return (\n <form {...domProps} ref={ref} className={className}>\n <FormContext.Provider value={{ validationBehavior: props.noValidate ? 'aria' : 'native' }}>\n <FormValidationContext.Provider value={validationErrors ?? {}}>\n {children}\n </FormValidationContext.Provider>\n </FormContext.Provider>\n </form>\n );\n}\n\nconst Form = forwardRef(_Form);\nexport { Form };\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,IAAA,eAAAC,EAAAH,GAoBQ,IAAAI,EAAA,6BApBRC,EAA4B,iCAC5BC,EAAsC,yBACtCC,EAA2B,iBAa3B,SAASC,EAAMC,EAAkBC,EAAoC,CACnE,GAAI,CAAE,iBAAAC,EAAkB,SAAAC,EAAU,UAAAC,EAAW,GAAGC,CAAS,EAAIL,EAC7D,SACE,OAAC,QAAM,GAAGK,EAAU,IAAKJ,EAAK,UAAWG,EACvC,mBAAC,cAAY,SAAZ,CAAqB,MAAO,CAAE,mBAAoBJ,EAAM,WAAa,OAAS,QAAS,EACtF,mBAAC,wBAAsB,SAAtB,CAA+B,MAAOE,GAAoB,CAAC,EACzD,SAAAC,EACH,EACF,EACF,CAEJ,CAEA,MAAMV,KAAO,cAAWM,CAAK",
|
|
6
|
+
"names": ["form_exports", "__export", "Form", "__toCommonJS", "import_jsx_runtime", "import_react_aria_components", "import_react_stately", "import_react", "_Form", "props", "ref", "validationErrors", "children", "className", "domProps"]
|
|
7
|
+
}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
export * from './button.js';
|
|
2
2
|
export * from './card.js';
|
|
3
|
+
export * from './checkbox.js';
|
|
3
4
|
export * from './flex.js';
|
|
5
|
+
export * from './form.js';
|
|
4
6
|
export * from './heading.js';
|
|
5
7
|
export * from './icon-button.js';
|
|
8
|
+
export * from './link.js';
|
|
9
|
+
export * from './number-field.js';
|
|
6
10
|
export * as Popover from './popover.js';
|
|
7
11
|
export * from './toast.js';
|
|
8
12
|
export * from './text.js';
|
|
13
|
+
export * from './text-area.js';
|
|
9
14
|
export * from './text-field.js';
|
|
10
15
|
export * from './theme.js';
|
|
11
16
|
export * as Tooltip from './tooltip.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var i=Object.create;var x=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var b=(p,e)=>{for(var t in e)x(p,t,{get:e[t],enumerable:!0})},m=(p,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let f of v(e))!T.call(p,f)&&f!==t&&x(p,f,{get:()=>e[f],enumerable:!(a=l(e,f))||a.enumerable});return p},r=(p,e,t)=>(m(p,e,"default"),t&&m(t,e,"default")),s=(p,e,t)=>(t=p!=null?i(P(p)):{},m(e||!p||!p.__esModule?x(t,"default",{value:p,enumerable:!0}):t,p)),c=p=>m(x({},"__esModule",{value:!0}),p);var o={};b(o,{Popover:()=>d,Tooltip:()=>g});module.exports=c(o);r(o,require("./button.js"),module.exports);r(o,require("./card.js"),module.exports);r(o,require("./flex.js"),module.exports);r(o,require("./heading.js"),module.exports);r(o,require("./icon-button.js"),module.exports);var d=s(require("./popover.js"));r(o,require("./toast.js"),module.exports);r(o,require("./text.js"),module.exports);r(o,require("./text-field.js"),module.exports);r(o,require("./theme.js"),module.exports);var g=s(require("./tooltip.js"));
|
|
1
|
+
"use strict";var i=Object.create;var x=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var b=(p,e)=>{for(var t in e)x(p,t,{get:e[t],enumerable:!0})},m=(p,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let f of v(e))!T.call(p,f)&&f!==t&&x(p,f,{get:()=>e[f],enumerable:!(a=l(e,f))||a.enumerable});return p},r=(p,e,t)=>(m(p,e,"default"),t&&m(t,e,"default")),s=(p,e,t)=>(t=p!=null?i(P(p)):{},m(e||!p||!p.__esModule?x(t,"default",{value:p,enumerable:!0}):t,p)),c=p=>m(x({},"__esModule",{value:!0}),p);var o={};b(o,{Popover:()=>d,Tooltip:()=>g});module.exports=c(o);r(o,require("./button.js"),module.exports);r(o,require("./card.js"),module.exports);r(o,require("./checkbox.js"),module.exports);r(o,require("./flex.js"),module.exports);r(o,require("./form.js"),module.exports);r(o,require("./heading.js"),module.exports);r(o,require("./icon-button.js"),module.exports);r(o,require("./link.js"),module.exports);r(o,require("./number-field.js"),module.exports);var d=s(require("./popover.js"));r(o,require("./toast.js"),module.exports);r(o,require("./text.js"),module.exports);r(o,require("./text-area.js"),module.exports);r(o,require("./text-field.js"),module.exports);r(o,require("./theme.js"),module.exports);var g=s(require("./tooltip.js"));
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * from './button.js';\nexport * from './card.js';\nexport * from './flex.js';\nexport * from './heading.js';\nexport * from './icon-button.js';\nexport * as Popover from './popover.js';\nexport * from './toast.js';\nexport * from './text.js';\nexport * from './text-field.js';\nexport * from './theme.js';\nexport * as Tooltip from './tooltip.js';\n"],
|
|
5
|
-
"mappings": "wmBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,YAAAC,IAAA,eAAAC,EAAAJ,GAAAK,EAAAL,EAAc,uBAAd,gBACAK,EAAAL,EAAc,qBADd,gBAEAK,EAAAL,EAAc,
|
|
4
|
+
"sourcesContent": ["export * from './button.js';\nexport * from './card.js';\nexport * from './checkbox.js';\nexport * from './flex.js';\nexport * from './form.js';\nexport * from './heading.js';\nexport * from './icon-button.js';\nexport * from './link.js';\nexport * from './number-field.js';\nexport * as Popover from './popover.js';\nexport * from './toast.js';\nexport * from './text.js';\nexport * from './text-area.js';\nexport * from './text-field.js';\nexport * from './theme.js';\nexport * as Tooltip from './tooltip.js';\n"],
|
|
5
|
+
"mappings": "wmBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,YAAAC,IAAA,eAAAC,EAAAJ,GAAAK,EAAAL,EAAc,uBAAd,gBACAK,EAAAL,EAAc,qBADd,gBAEAK,EAAAL,EAAc,yBAFd,gBAGAK,EAAAL,EAAc,qBAHd,gBAIAK,EAAAL,EAAc,qBAJd,gBAKAK,EAAAL,EAAc,wBALd,gBAMAK,EAAAL,EAAc,4BANd,gBAOAK,EAAAL,EAAc,qBAPd,gBAQAK,EAAAL,EAAc,6BARd,gBASA,IAAAE,EAAyB,2BACzBG,EAAAL,EAAc,sBAVd,gBAWAK,EAAAL,EAAc,qBAXd,gBAYAK,EAAAL,EAAc,0BAZd,gBAaAK,EAAAL,EAAc,2BAbd,gBAcAK,EAAAL,EAAc,sBAdd,gBAeA,IAAAG,EAAyB",
|
|
6
6
|
"names": ["components_exports", "__export", "Popover", "Tooltip", "__toCommonJS", "__reExport"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type SlotProps } from 'react-aria-components';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
import type { AriaLinkOptions, HoverEvents } from 'react-aria';
|
|
4
|
+
import { type LinkVariantProps } from '../variants/index.js';
|
|
5
|
+
export interface LinkProps extends Omit<AriaLinkOptions, 'elementType'>, SlotProps, HoverEvents, LinkVariantProps {
|
|
6
|
+
asChild?: boolean;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare const Link: import("react").ForwardRefExoticComponent<LinkProps & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
10
|
+
export { Link };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var m=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var B=Object.prototype.hasOwnProperty;var G=(e,n)=>{for(var t in n)m(e,t,{get:n[t],enumerable:!0})},I=(e,n,t,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of q(n))!B.call(e,i)&&i!==t&&m(e,i,{get:()=>n[i],enumerable:!(a=_(n,i))||a.enumerable});return e};var J=e=>I(m({},"__esModule",{value:!0}),e);var Q={};G(Q,{Link:()=>v});module.exports=J(Q);var k=require("react/jsx-runtime"),r=require("react-aria-components"),d=require("@react-aria/utils"),l=require("react"),o=require("react-aria"),f=require("@radix-ui/react-slot"),u=require("react"),P=require("../variants/index.js"),s=require("../utils/helpers.js");function K(e,n){[e,n]=(0,r.useContextProps)(e,n,r.TextContext),[e,n]=(0,r.useContextProps)(e,n,r.LinkContext);const{asChild:t,children:a,size:i,align:L,color:y,variant:p,weight:C,transform:E,underline:H}=e;let h=t&&(0,l.isValidElement)(a)&&a?.type||"a";const[R,T]=(0,s.fallbackEventTo)(e,"onPress","onClick"),[S,b]=(0,s.fallbackEventTo)(e,"onPressStart","onPointerDown"),[g,w]=(0,s.fallbackEventTo)(e,"onHoverStart","onPointerMove"),[x,F]=(0,s.fallbackEventTo)(e,"onHoverEnd","onPointerLeave"),c=(0,u.useRef)(null);let{linkProps:M,isPressed:A}=(0,o.useLink)({...e,elementType:h,onPress:R,onPressStart:S,onClick:T,onPointerDown:b,onPointerMove:w,onPointerLeave:F},c),{focusProps:D,isFocused:O,isFocusVisible:V}=(0,o.useFocusRing)(e),{hoverProps:N,isHovered:z}=(0,o.useHover)({...e,onHoverStart:g,onHoverEnd:x});return(0,k.jsx)(t?f.Slot:"a",{...(0,d.filterDOMProps)(e),...(0,o.mergeProps)(M,D,N),slot:e.slot||void 0,ref:(0,d.mergeRefs)(n,c),"data-disabled":e.isDisabled||void 0,"data-pressed":A||void 0,"data-hovered":z||void 0,"data-focused":O||void 0,"data-focus-visible":V||void 0,"data-current":!!e["aria-current"]||void 0,className:(0,P.link)({size:i,align:L,color:y,variant:p,weight:C,transform:E,underline:H}),children:a})}const v=(0,l.forwardRef)(K);
|
|
2
|
+
//# sourceMappingURL=link.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/link.tsx"],
|
|
4
|
+
"sourcesContent": ["import { LinkContext, TextContext, useContextProps, type SlotProps } from 'react-aria-components';\nimport { filterDOMProps, mergeRefs } from '@react-aria/utils';\nimport {\n forwardRef,\n isValidElement,\n type ElementType,\n type ForwardedRef,\n type ReactNode,\n} from 'react';\nimport { mergeProps, useFocusRing, useHover, useLink } from 'react-aria';\nimport { Slot } from '@radix-ui/react-slot';\nimport { useRef } from 'react';\nimport type { AriaLinkOptions, HoverEvents } from 'react-aria';\n\nimport { link, type LinkVariantProps } from '../variants/index.js';\nimport { fallbackEventTo } from '../utils/helpers.js';\n\nexport interface LinkProps\n extends Omit<AriaLinkOptions, 'elementType'>,\n SlotProps,\n HoverEvents,\n LinkVariantProps {\n asChild?: boolean;\n children?: ReactNode;\n}\n\nfunction _Link(props: LinkProps, ref: ForwardedRef<HTMLAnchorElement>) {\n // @ts-ignore\n [props, ref] = useContextProps(props, ref, TextContext);\n [props, ref] = useContextProps(props, ref, LinkContext);\n const { asChild, children, size, align, color, variant, weight, transform, underline } = props;\n let elementType = asChild\n ? (isValidElement(children) && (children?.type as ElementType)) || 'a'\n : 'a';\n\n const [onPress, onClick] = fallbackEventTo(props, 'onPress', 'onClick');\n const [onPressStart, onPointerDown] = fallbackEventTo(props, 'onPressStart', 'onPointerDown');\n const [onHoverStart, onPointerMove] = fallbackEventTo(props, 'onHoverStart', 'onPointerMove');\n const [onHoverEnd, onPointerLeave] = fallbackEventTo(props, 'onHoverEnd', 'onPointerLeave');\n const innerRef = useRef<HTMLAnchorElement>(null);\n let { linkProps, isPressed } = useLink(\n {\n ...props,\n // @ts-ignore\n elementType,\n onPress,\n onPressStart,\n // @ts-ignore\n onClick,\n // @ts-ignore\n onPointerDown,\n // @ts-ignore\n onPointerMove,\n // @ts-ignore\n onPointerLeave,\n },\n innerRef,\n );\n let { focusProps, isFocused, isFocusVisible } = useFocusRing(props);\n\n let { hoverProps, isHovered } = useHover({\n ...props,\n onHoverStart,\n onHoverEnd,\n });\n\n let Comp = asChild ? Slot : 'a';\n\n return (\n <Comp\n {...filterDOMProps(props)}\n {...mergeProps(linkProps, focusProps, hoverProps)}\n slot={props.slot || undefined}\n ref={mergeRefs(ref, innerRef)}\n data-disabled={props.isDisabled || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n // @ts-ignore\n data-current={!!props['aria-current'] || undefined}\n className={link({ size, align, color, variant, weight, transform, underline })}\n >\n {children}\n </Comp>\n );\n}\n\nconst Link = /*#__PURE__*/ forwardRef(_Link);\nexport { Link };\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,IAAA,eAAAC,EAAAH,GAqEI,IAAAI,EAAA,6BArEJC,EAA0E,iCAC1EC,EAA0C,6BAC1CC,EAMO,iBACPC,EAA4D,sBAC5DC,EAAqB,gCACrBF,EAAuB,iBAGvBG,EAA4C,gCAC5CC,EAAgC,+BAWhC,SAASC,EAAMC,EAAkBC,EAAsC,CAErE,CAACD,EAAOC,CAAG,KAAI,mBAAgBD,EAAOC,EAAK,aAAW,EACtD,CAACD,EAAOC,CAAG,KAAI,mBAAgBD,EAAOC,EAAK,aAAW,EACtD,KAAM,CAAE,QAAAC,EAAS,SAAAC,EAAU,KAAAC,EAAM,MAAAC,EAAO,MAAAC,EAAO,QAAAC,EAAS,OAAAC,EAAQ,UAAAC,EAAW,UAAAC,CAAU,EAAIV,EACzF,IAAIW,EAAcT,MACb,kBAAeC,CAAQ,GAAMA,GAAU,MAAyB,IAGrE,KAAM,CAACS,EAASC,CAAO,KAAI,mBAAgBb,EAAO,UAAW,SAAS,EAChE,CAACc,EAAcC,CAAa,KAAI,mBAAgBf,EAAO,eAAgB,eAAe,EACtF,CAACgB,EAAcC,CAAa,KAAI,mBAAgBjB,EAAO,eAAgB,eAAe,EACtF,CAACkB,EAAYC,CAAc,KAAI,mBAAgBnB,EAAO,aAAc,gBAAgB,EACpFoB,KAAW,UAA0B,IAAI,EAC/C,GAAI,CAAE,UAAAC,EAAW,UAAAC,CAAU,KAAI,WAC7B,CACE,GAAGtB,EAEH,YAAAW,EACA,QAAAC,EACA,aAAAE,EAEA,QAAAD,EAEA,cAAAE,EAEA,cAAAE,EAEA,eAAAE,CACF,EACAC,CACF,EACI,CAAE,WAAAG,EAAY,UAAAC,EAAW,eAAAC,CAAe,KAAI,gBAAazB,CAAK,EAE9D,CAAE,WAAA0B,EAAY,UAAAC,CAAU,KAAI,YAAS,CACvC,GAAG3B,EACH,aAAAgB,EACA,WAAAE,CACF,CAAC,EAID,SACE,OAHShB,EAAU,OAAO,IAGzB,CACE,MAAG,kBAAeF,CAAK,EACvB,MAAG,cAAWqB,EAAWE,EAAYG,CAAU,EAChD,KAAM1B,EAAM,MAAQ,OACpB,OAAK,aAAUC,EAAKmB,CAAQ,EAC5B,gBAAepB,EAAM,YAAc,OACnC,eAAcsB,GAAa,OAC3B,eAAcK,GAAa,OAC3B,eAAcH,GAAa,OAC3B,qBAAoBC,GAAkB,OAEtC,eAAc,CAAC,CAACzB,EAAM,cAAc,GAAK,OACzC,aAAW,QAAK,CAAE,KAAAI,EAAM,MAAAC,EAAO,MAAAC,EAAO,QAAAC,EAAS,OAAAC,EAAQ,UAAAC,EAAW,UAAAC,CAAU,CAAC,EAE5E,SAAAP,EACH,CAEJ,CAEA,MAAMd,KAAqB,cAAWU,CAAK",
|
|
6
|
+
"names": ["link_exports", "__export", "Link", "__toCommonJS", "import_jsx_runtime", "import_react_aria_components", "import_utils", "import_react", "import_react_aria", "import_react_slot", "import_variants", "import_helpers", "_Link", "props", "ref", "asChild", "children", "size", "align", "color", "variant", "weight", "transform", "underline", "elementType", "onPress", "onClick", "onPressStart", "onPointerDown", "onHoverStart", "onPointerMove", "onHoverEnd", "onPointerLeave", "innerRef", "linkProps", "isPressed", "focusProps", "isFocused", "isFocusVisible", "hoverProps", "isHovered"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { NumberFieldProps as BaseNumberFieldProps, ValidationResult } from 'react-aria-components';
|
|
3
|
+
import type { TextFieldVariantProps } from '../variants/index.js';
|
|
4
|
+
interface NumberFieldProps extends BaseNumberFieldProps, TextFieldVariantProps {
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
description?: string | ReactNode;
|
|
8
|
+
errorMessage?: string | ((validation: ValidationResult) => string);
|
|
9
|
+
}
|
|
10
|
+
declare const NumberField: import("react").ForwardRefExoticComponent<NumberFieldProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export { NumberField };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var b=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var O=Object.prototype.hasOwnProperty;var S=(i,t)=>{for(var l in t)b(i,l,{get:t[l],enumerable:!0})},U=(i,t,l,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of A(t))!O.call(i,d)&&d!==l&&b(i,d,{get:()=>t[d],enumerable:!(a=j(t,d))||a.enumerable});return i};var _=i=>U(b({},"__esModule",{value:!0}),i);var k={};S(k,{NumberField:()=>w});module.exports=_(k);var e=require("react/jsx-runtime"),N=require("@radix-ui/react-use-rect"),u=require("react-aria-components"),F=require("react-stately"),m=require("../utils/cn.js"),P=require("../variants/field-error.js"),R=require("../variants/index.js"),n=require("./index.js"),y=require("@react-aria/utils"),p=require("lucide-react"),s=require("react"),c=require("react-aria"),T=require("../utils/helpers.js");function $({label:i,description:t,errorMessage:l,size:a="medium",roundness:d="medium",elevation:f="medium",...r},g){const[E,B]=(0,s.useState)(null),v=(0,N.useRect)(E);[r,g]=(0,u.useContextProps)(r,g,u.NumberFieldContext);let{locale:D}=(0,c.useLocale)(),x=(0,F.useNumberFieldState)({...r,locale:D}),h=(0,s.useRef)(null),{labelProps:V,groupProps:q,inputProps:C,incrementButtonProps:I,decrementButtonProps:L,descriptionProps:H,errorMessageProps:M,...o}=(0,c.useNumberField)({...(0,T.removeDataAttributes)(r),label:i},x,h);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(n.Flex,{gap:2,direction:"column",...(0,y.filterDOMProps)(r),ref:g,slot:r.slot||void 0,"data-disabled":r.isDisabled||void 0,"data-invalid":o.isInvalid||void 0,children:[i&&(0,e.jsx)(n.Text,{...V,size:1,transform:"uppercase",weight:"semibold",variant:"tertiary",color:"gray",children:i}),(0,e.jsxs)("div",{...q,className:"relative","data-radius":d,"data-shadow":f,children:[(0,e.jsx)("input",{...C,ref:h,style:{"--append-padding-right":v?`${v.width}px`:0},className:(0,m.cn)("dx","w-full",(0,R.textField)({size:a,roundness:d,elevation:f})),"data-disabled":r.isDisabled||void 0,"data-invalid":o.isInvalid||void 0,"data-readonly":r.isReadOnly||void 0,"data-required":r.isRequired||void 0}),(0,e.jsxs)(n.Flex,{ref:B,direction:["large","extralarge"].includes(a)?"column":"row-reverse",align:["large","extralarge"].includes(a)?"start":"center",justify:["large","extralarge"].includes(a)?"center":"start",className:(0,m.cn)("absolute top-[0] bottom-[0] transform",{"right-3":["extrasmall","small"].includes(a),"right-4":["medium","large"].includes(a),"right-6":a==="extralarge"}),children:[(0,e.jsx)(n.Button,{...I,size:"extrasmall",shape:"square",variant:"ghost",mode:"subtle",inset:"right",slot:"increment",children:(0,e.jsx)(p.ChevronUp,{})}),(0,e.jsx)(n.Button,{...L,size:"extrasmall",shape:"square",variant:"ghost",mode:"subtle",inset:"right",slot:"decrement",children:(0,e.jsx)(p.ChevronDown,{})})]}),o.isInvalid&&(0,e.jsx)(n.Text,{...M,size:1,className:(0,m.cn)("dx",(0,P.fieldError)({size:a,roundness:d,elevation:f})),children:l?typeof l=="string"?l:l(o):o.validationErrors.length===0?void 0:o.validationErrors.join(" ")})]}),t&&(0,e.jsx)(n.Text,{size:1,variant:"tertiary",...H,children:t})]}),r.name&&(0,e.jsx)("input",{type:"hidden",name:r.name,value:isNaN(x.numberValue)?"":x.numberValue})]})}const w=(0,s.forwardRef)($);
|
|
2
|
+
//# sourceMappingURL=number-field.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/number-field.tsx"],
|
|
4
|
+
"sourcesContent": ["import { useRect } from '@radix-ui/react-use-rect';\nimport { NumberFieldContext, useContextProps } from 'react-aria-components';\nimport { useNumberFieldState } from 'react-stately';\nimport { cn } from '../utils/cn.js';\nimport { fieldError } from '../variants/field-error.js';\nimport { textField } from '../variants/index.js';\nimport { Button, Flex, Text } from './index.js';\nimport { filterDOMProps } from '@react-aria/utils';\nimport { ChevronDown, ChevronUp } from 'lucide-react';\nimport { forwardRef, useRef, useState, type ReactNode } from 'react';\nimport { useLocale, useNumberField } from 'react-aria';\nimport { removeDataAttributes } from '../utils/helpers.js';\nimport type {\n NumberFieldProps as BaseNumberFieldProps,\n ValidationResult,\n} from 'react-aria-components';\nimport type { TextFieldVariantProps } from '../variants/index.js';\n\ninterface NumberFieldProps extends BaseNumberFieldProps, TextFieldVariantProps {\n placeholder?: string;\n label?: string;\n description?: string | ReactNode;\n errorMessage?: string | ((validation: ValidationResult) => string);\n}\n\nfunction _NumberField(\n {\n label,\n description,\n errorMessage,\n size = 'medium',\n roundness = 'medium',\n elevation = 'medium',\n ...props\n }: NumberFieldProps,\n ref: React.ForwardedRef<HTMLDivElement>,\n) {\n const [appendEl, setAppendEl] = useState<HTMLDivElement | null>(null);\n const appendRect = useRect(appendEl);\n [props, ref] = useContextProps(props, ref, NumberFieldContext);\n\n let { locale } = useLocale();\n let state = useNumberFieldState({\n ...props,\n locale,\n });\n\n let inputRef = useRef<HTMLInputElement>(null);\n\n let {\n labelProps,\n groupProps,\n inputProps,\n incrementButtonProps,\n decrementButtonProps,\n descriptionProps,\n errorMessageProps,\n ...validation\n } = useNumberField(\n {\n ...removeDataAttributes(props),\n label,\n },\n state,\n inputRef,\n );\n\n return (\n <>\n <Flex\n gap={2}\n direction=\"column\"\n {...filterDOMProps(props)}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={validation.isInvalid || undefined}\n >\n {label && (\n <Text\n {...labelProps}\n size={1}\n transform=\"uppercase\"\n weight=\"semibold\"\n variant=\"tertiary\"\n color=\"gray\"\n >\n {label}\n </Text>\n )}\n <div {...groupProps} className=\"relative\" data-radius={roundness} data-shadow={elevation}>\n <input\n {...inputProps}\n ref={inputRef}\n style={{\n // @ts-ignore\n '--append-padding-right': appendRect ? `${appendRect.width}px` : 0,\n }}\n className={cn('dx', 'w-full', textField({ size, roundness, elevation }))}\n data-disabled={props.isDisabled || undefined}\n data-invalid={validation.isInvalid || undefined}\n data-readonly={props.isReadOnly || undefined}\n data-required={props.isRequired || undefined}\n />\n <Flex\n ref={setAppendEl}\n direction={['large', 'extralarge'].includes(size) ? 'column' : 'row-reverse'}\n align={['large', 'extralarge'].includes(size) ? 'start' : 'center'}\n justify={['large', 'extralarge'].includes(size) ? 'center' : 'start'}\n className={cn('absolute top-[0] bottom-[0] transform', {\n 'right-3': ['extrasmall', 'small'].includes(size),\n 'right-4': ['medium', 'large'].includes(size),\n 'right-6': size === 'extralarge',\n })}\n >\n <Button\n {...incrementButtonProps}\n size=\"extrasmall\"\n shape=\"square\"\n variant=\"ghost\"\n mode=\"subtle\"\n inset=\"right\"\n slot=\"increment\"\n >\n <ChevronUp />\n </Button>\n <Button\n {...decrementButtonProps}\n size=\"extrasmall\"\n shape=\"square\"\n variant=\"ghost\"\n mode=\"subtle\"\n inset=\"right\"\n slot=\"decrement\"\n >\n <ChevronDown />\n </Button>\n </Flex>\n {validation.isInvalid && (\n <Text\n {...errorMessageProps}\n size={1}\n className={cn('dx', fieldError({ size, roundness, elevation }))}\n >\n {errorMessage\n ? typeof errorMessage === 'string'\n ? errorMessage\n : errorMessage(validation)\n : validation.validationErrors.length === 0\n ? undefined\n : validation.validationErrors.join(' ')}\n </Text>\n )}\n </div>\n {description && (\n <Text size={1} variant=\"tertiary\" {...descriptionProps}>\n {description}\n </Text>\n )}\n </Flex>\n {props.name && (\n <input\n type=\"hidden\"\n name={props.name}\n value={isNaN(state.numberValue) ? '' : state.numberValue}\n />\n )}\n </>\n );\n}\n\nconst NumberField = forwardRef(_NumberField);\n\nexport { NumberField };\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,IAAA,eAAAC,EAAAH,GAoEI,IAAAI,EAAA,6BApEJC,EAAwB,oCACxBC,EAAoD,iCACpDC,EAAoC,yBACpCC,EAAmB,0BACnBC,EAA2B,sCAC3BC,EAA0B,gCAC1BC,EAAmC,sBACnCC,EAA+B,6BAC/BC,EAAuC,wBACvCC,EAA6D,iBAC7DC,EAA0C,sBAC1CC,EAAqC,+BAcrC,SAASC,EACP,CACE,MAAAC,EACA,YAAAC,EACA,aAAAC,EACA,KAAAC,EAAO,SACP,UAAAC,EAAY,SACZ,UAAAC,EAAY,SACZ,GAAGC,CACL,EACAC,EACA,CACA,KAAM,CAACC,EAAUC,CAAW,KAAI,YAAgC,IAAI,EAC9DC,KAAa,WAAQF,CAAQ,EACnC,CAACF,EAAOC,CAAG,KAAI,mBAAgBD,EAAOC,EAAK,oBAAkB,EAE7D,GAAI,CAAE,OAAAI,CAAO,KAAI,aAAU,EACvBC,KAAQ,uBAAoB,CAC9B,GAAGN,EACH,OAAAK,CACF,CAAC,EAEGE,KAAW,UAAyB,IAAI,EAExC,CACF,WAAAC,EACA,WAAAC,EACA,WAAAC,EACA,qBAAAC,EACA,qBAAAC,EACA,iBAAAC,EACA,kBAAAC,EACA,GAAGC,CACL,KAAI,kBACF,CACE,MAAG,wBAAqBf,CAAK,EAC7B,MAAAN,CACF,EACAY,EACAC,CACF,EAEA,SACE,oBACE,qBAAC,QACC,IAAK,EACL,UAAU,SACT,MAAG,kBAAeP,CAAK,EACxB,IAAKC,EACL,KAAMD,EAAM,MAAQ,OACpB,gBAAeA,EAAM,YAAc,OACnC,eAAce,EAAW,WAAa,OAErC,UAAArB,MACC,OAAC,QACE,GAAGc,EACJ,KAAM,EACN,UAAU,YACV,OAAO,WACP,QAAQ,WACR,MAAM,OAEL,SAAAd,EACH,KAEF,QAAC,OAAK,GAAGe,EAAY,UAAU,WAAW,cAAaX,EAAW,cAAaC,EAC7E,oBAAC,SACE,GAAGW,EACJ,IAAKH,EACL,MAAO,CAEL,yBAA0BH,EAAa,GAAGA,EAAW,KAAK,KAAO,CACnE,EACA,aAAW,MAAG,KAAM,YAAU,aAAU,CAAE,KAAAP,EAAM,UAAAC,EAAW,UAAAC,CAAU,CAAC,CAAC,EACvE,gBAAeC,EAAM,YAAc,OACnC,eAAce,EAAW,WAAa,OACtC,gBAAef,EAAM,YAAc,OACnC,gBAAeA,EAAM,YAAc,OACrC,KACA,QAAC,QACC,IAAKG,EACL,UAAW,CAAC,QAAS,YAAY,EAAE,SAASN,CAAI,EAAI,SAAW,cAC/D,MAAO,CAAC,QAAS,YAAY,EAAE,SAASA,CAAI,EAAI,QAAU,SAC1D,QAAS,CAAC,QAAS,YAAY,EAAE,SAASA,CAAI,EAAI,SAAW,QAC7D,aAAW,MAAG,wCAAyC,CACrD,UAAW,CAAC,aAAc,OAAO,EAAE,SAASA,CAAI,EAChD,UAAW,CAAC,SAAU,OAAO,EAAE,SAASA,CAAI,EAC5C,UAAWA,IAAS,YACtB,CAAC,EAED,oBAAC,UACE,GAAGc,EACJ,KAAK,aACL,MAAM,SACN,QAAQ,QACR,KAAK,SACL,MAAM,QACN,KAAK,YAEL,mBAAC,cAAU,EACb,KACA,OAAC,UACE,GAAGC,EACJ,KAAK,aACL,MAAM,SACN,QAAQ,QACR,KAAK,SACL,MAAM,QACN,KAAK,YAEL,mBAAC,gBAAY,EACf,GACF,EACCG,EAAW,cACV,OAAC,QACE,GAAGD,EACJ,KAAM,EACN,aAAW,MAAG,QAAM,cAAW,CAAE,KAAAjB,EAAM,UAAAC,EAAW,UAAAC,CAAU,CAAC,CAAC,EAE7D,SAAAH,EACG,OAAOA,GAAiB,SACtBA,EACAA,EAAamB,CAAU,EACzBA,EAAW,iBAAiB,SAAW,EACrC,OACAA,EAAW,iBAAiB,KAAK,GAAG,EAC5C,GAEJ,EACCpB,MACC,OAAC,QAAK,KAAM,EAAG,QAAQ,WAAY,GAAGkB,EACnC,SAAAlB,EACH,GAEJ,EACCK,EAAM,SACL,OAAC,SACC,KAAK,SACL,KAAMA,EAAM,KACZ,MAAO,MAAMM,EAAM,WAAW,EAAI,GAAKA,EAAM,YAC/C,GAEJ,CAEJ,CAEA,MAAM5B,KAAc,cAAWe,CAAY",
|
|
6
|
+
"names": ["number_field_exports", "__export", "NumberField", "__toCommonJS", "import_jsx_runtime", "import_react_use_rect", "import_react_aria_components", "import_react_stately", "import_cn", "import_field_error", "import_variants", "import_index", "import_utils", "import_lucide_react", "import_react", "import_react_aria", "import_helpers", "_NumberField", "label", "description", "errorMessage", "size", "roundness", "elevation", "props", "ref", "appendEl", "setAppendEl", "appendRect", "locale", "state", "inputRef", "labelProps", "groupProps", "inputProps", "incrementButtonProps", "decrementButtonProps", "descriptionProps", "errorMessageProps", "validation"]
|
|
7
|
+
}
|
|
@@ -20,25 +20,25 @@ type PopoverBodyProps = React.PropsWithChildren<{
|
|
|
20
20
|
asChild?: boolean;
|
|
21
21
|
}>;
|
|
22
22
|
declare const PopoverBody: React.ForwardRefExoticComponent<{
|
|
23
|
-
asChild?: boolean
|
|
23
|
+
asChild?: boolean;
|
|
24
24
|
} & {
|
|
25
|
-
children?: React.ReactNode;
|
|
25
|
+
children?: React.ReactNode | undefined;
|
|
26
26
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
27
27
|
type PopoverHeaderProps = React.PropsWithChildren<{
|
|
28
28
|
asChild?: boolean;
|
|
29
29
|
}>;
|
|
30
30
|
declare const PopoverHeader: React.ForwardRefExoticComponent<{
|
|
31
|
-
asChild?: boolean
|
|
31
|
+
asChild?: boolean;
|
|
32
32
|
} & {
|
|
33
|
-
children?: React.ReactNode;
|
|
33
|
+
children?: React.ReactNode | undefined;
|
|
34
34
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
35
35
|
type PopoverFooterProps = React.PropsWithChildren<{
|
|
36
36
|
asChild?: boolean;
|
|
37
37
|
}>;
|
|
38
38
|
declare const PopoverFooter: React.ForwardRefExoticComponent<{
|
|
39
|
-
asChild?: boolean
|
|
39
|
+
asChild?: boolean;
|
|
40
40
|
} & {
|
|
41
|
-
children?: React.ReactNode;
|
|
41
|
+
children?: React.ReactNode | undefined;
|
|
42
42
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
43
43
|
interface PopoverCloseProps extends React.PropsWithChildren<{}> {
|
|
44
44
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { TextFieldProps, ValidationResult } from 'react-aria-components';
|
|
3
|
+
import { type TextAreaVariantProps } from '../variants/text-area.js';
|
|
4
|
+
interface TextAreaProps extends TextFieldProps, TextAreaVariantProps {
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
description?: string | ReactNode;
|
|
8
|
+
errorMessage?: string | ((validation: ValidationResult) => string);
|
|
9
|
+
}
|
|
10
|
+
declare const TextArea: import("react").ForwardRefExoticComponent<TextAreaProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export { TextArea };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var x=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var h=(t,e)=>{for(var a in e)x(t,a,{get:e[a],enumerable:!0})},q=(t,e,a,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of E(e))!N.call(t,r)&&r!==a&&x(t,r,{get:()=>e[r],enumerable:!(l=D(e,r))||l.enumerable});return t};var V=t=>q(x({},"__esModule",{value:!0}),t);var O={};h(O,{TextArea:()=>g});module.exports=V(O);var d=require("react/jsx-runtime"),s=require("react-aria-components"),p=require("../utils/cn.js"),o=require("./index.js"),T=require("../variants/field-error.js"),v=require("@react-aria/utils"),y=require("react-aria"),m=require("react"),R=require("../utils/helpers.js"),P=require("../variants/text-area.js");function I({label:t,description:e,errorMessage:a,size:l="medium",roundness:r="medium",elevation:f="medium",...i},u){[i,u]=(0,s.useContextProps)(i,u,s.TextFieldContext);let c=(0,m.useRef)(null),{labelProps:A,inputProps:F,descriptionProps:b,errorMessageProps:w,...n}=(0,y.useTextField)({...(0,R.removeDataAttributes)(i),inputElementType:"text-area",label:t},c);return(0,d.jsxs)(o.Flex,{...(0,v.filterDOMProps)(i),gap:2,direction:"column",ref:u,slot:i.slot||void 0,"data-disabled":i.isDisabled||void 0,"data-invalid":n.isInvalid||void 0,"data-readonly":i.isReadOnly||void 0,"data-required":i.isRequired||void 0,children:[t&&(0,d.jsx)(o.Text,{...A,size:1,transform:"uppercase",weight:"semibold",variant:"tertiary",color:"gray",children:t}),(0,d.jsxs)("div",{role:"group",className:"relative","data-radius":r,"data-shadow":f,children:[(0,d.jsx)("textarea",{...F,ref:c,className:(0,p.cn)("dx","w-full",(0,P.textArea)({size:l,roundness:r,elevation:f})),"data-disabled":i.isDisabled||void 0,"data-invalid":n.isInvalid||void 0,"data-readonly":i.isReadOnly||void 0,"data-required":i.isRequired||void 0}),n.isInvalid&&(0,d.jsx)(o.Text,{...w,size:1,className:(0,p.cn)("dx",(0,T.fieldError)({size:l,roundness:r,elevation:f})),children:a?typeof a=="string"?a:a(n):n.validationErrors.length===0?void 0:n.validationErrors.join(" ")})]}),e&&(0,d.jsx)(o.Text,{size:1,variant:"tertiary",...b,children:e})]})}const g=(0,m.forwardRef)(I);
|
|
2
|
+
//# sourceMappingURL=text-area.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/text-area.tsx"],
|
|
4
|
+
"sourcesContent": ["import { useContextProps, TextFieldContext } from 'react-aria-components';\nimport { cn } from '../utils/cn.js';\n\nimport { Flex, Text } from './index.js';\nimport { fieldError } from '../variants/field-error.js';\nimport { filterDOMProps } from '@react-aria/utils';\nimport { useTextField } from 'react-aria';\nimport { forwardRef, useRef, type ReactNode } from 'react';\nimport { removeDataAttributes } from '../utils/helpers.js';\n\nimport type { TextFieldProps, ValidationResult } from 'react-aria-components';\nimport { textArea, type TextAreaVariantProps } from '../variants/text-area.js';\n\ninterface TextAreaProps extends TextFieldProps, TextAreaVariantProps {\n placeholder?: string;\n label?: string;\n description?: string | ReactNode;\n errorMessage?: string | ((validation: ValidationResult) => string);\n}\n\nfunction _TextArea(\n {\n label,\n description,\n errorMessage,\n size = 'medium',\n roundness = 'medium',\n elevation = 'medium',\n ...props\n }: TextAreaProps,\n ref: React.ForwardedRef<HTMLDivElement>,\n) {\n [props, ref] = useContextProps(props, ref, TextFieldContext);\n let inputRef = useRef(null);\n\n let { labelProps, inputProps, descriptionProps, errorMessageProps, ...validation } =\n useTextField<any>(\n {\n ...removeDataAttributes(props),\n inputElementType: 'text-area',\n label,\n },\n inputRef,\n );\n\n return (\n <Flex\n {...filterDOMProps(props)}\n gap={2}\n direction=\"column\"\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={validation.isInvalid || undefined}\n data-readonly={props.isReadOnly || undefined}\n data-required={props.isRequired || undefined}\n >\n {label && (\n <Text\n {...labelProps}\n size={1}\n transform=\"uppercase\"\n weight=\"semibold\"\n variant=\"tertiary\"\n color=\"gray\"\n >\n {label}\n </Text>\n )}\n <div role=\"group\" className=\"relative\" data-radius={roundness} data-shadow={elevation}>\n <textarea\n {...inputProps}\n ref={inputRef}\n className={cn('dx', 'w-full', textArea({ size, roundness, elevation }))}\n data-disabled={props.isDisabled || undefined}\n data-invalid={validation.isInvalid || undefined}\n data-readonly={props.isReadOnly || undefined}\n data-required={props.isRequired || undefined}\n />\n {validation.isInvalid && (\n <Text\n {...errorMessageProps}\n size={1}\n className={cn('dx', fieldError({ size, roundness, elevation }))}\n >\n {errorMessage\n ? typeof errorMessage === 'string'\n ? errorMessage\n : errorMessage(validation)\n : validation.validationErrors.length === 0\n ? undefined\n : validation.validationErrors.join(' ')}\n </Text>\n )}\n </div>\n {description && (\n <Text size={1} variant=\"tertiary\" {...descriptionProps}>\n {description}\n </Text>\n )}\n </Flex>\n );\n}\n\nconst TextArea = forwardRef(_TextArea);\n\nexport { TextArea };\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,IAAA,eAAAC,EAAAH,GA0DQ,IAAAI,EAAA,6BA1DRC,EAAkD,iCAClDC,EAAmB,0BAEnBC,EAA2B,sBAC3BC,EAA2B,sCAC3BC,EAA+B,6BAC/BC,EAA6B,sBAC7BC,EAAmD,iBACnDC,EAAqC,+BAGrCC,EAAoD,oCASpD,SAASC,EACP,CACE,MAAAC,EACA,YAAAC,EACA,aAAAC,EACA,KAAAC,EAAO,SACP,UAAAC,EAAY,SACZ,UAAAC,EAAY,SACZ,GAAGC,CACL,EACAC,EACA,CACA,CAACD,EAAOC,CAAG,KAAI,mBAAgBD,EAAOC,EAAK,kBAAgB,EAC3D,IAAIC,KAAW,UAAO,IAAI,EAEtB,CAAE,WAAAC,EAAY,WAAAC,EAAY,iBAAAC,EAAkB,kBAAAC,EAAmB,GAAGC,CAAW,KAC/E,gBACE,CACE,MAAG,wBAAqBP,CAAK,EAC7B,iBAAkB,YAClB,MAAAN,CACF,EACAQ,CACF,EAEF,SACE,QAAC,QACE,MAAG,kBAAeF,CAAK,EACxB,IAAK,EACL,UAAU,SACV,IAAKC,EACL,KAAMD,EAAM,MAAQ,OACpB,gBAAeA,EAAM,YAAc,OACnC,eAAcO,EAAW,WAAa,OACtC,gBAAeP,EAAM,YAAc,OACnC,gBAAeA,EAAM,YAAc,OAElC,UAAAN,MACC,OAAC,QACE,GAAGS,EACJ,KAAM,EACN,UAAU,YACV,OAAO,WACP,QAAQ,WACR,MAAM,OAEL,SAAAT,EACH,KAEF,QAAC,OAAI,KAAK,QAAQ,UAAU,WAAW,cAAaI,EAAW,cAAaC,EAC1E,oBAAC,YACE,GAAGK,EACJ,IAAKF,EACL,aAAW,MAAG,KAAM,YAAU,YAAS,CAAE,KAAAL,EAAM,UAAAC,EAAW,UAAAC,CAAU,CAAC,CAAC,EACtE,gBAAeC,EAAM,YAAc,OACnC,eAAcO,EAAW,WAAa,OACtC,gBAAeP,EAAM,YAAc,OACnC,gBAAeA,EAAM,YAAc,OACrC,EACCO,EAAW,cACV,OAAC,QACE,GAAGD,EACJ,KAAM,EACN,aAAW,MAAG,QAAM,cAAW,CAAE,KAAAT,EAAM,UAAAC,EAAW,UAAAC,CAAU,CAAC,CAAC,EAE7D,SAAAH,EACG,OAAOA,GAAiB,SACtBA,EACAA,EAAaW,CAAU,EACzBA,EAAW,iBAAiB,SAAW,EACrC,OACAA,EAAW,iBAAiB,KAAK,GAAG,EAC5C,GAEJ,EACCZ,MACC,OAAC,QAAK,KAAM,EAAG,QAAQ,WAAY,GAAGU,EACnC,SAAAV,EACH,GAEJ,CAEJ,CAEA,MAAMd,KAAW,cAAWY,CAAS",
|
|
6
|
+
"names": ["text_area_exports", "__export", "TextArea", "__toCommonJS", "import_jsx_runtime", "import_react_aria_components", "import_cn", "import_index", "import_field_error", "import_utils", "import_react_aria", "import_react", "import_helpers", "import_text_area", "_TextArea", "label", "description", "errorMessage", "size", "roundness", "elevation", "props", "ref", "inputRef", "labelProps", "inputProps", "descriptionProps", "errorMessageProps", "validation"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { TextFieldVariantProps } from '../variants/index.js';
|
|
3
|
+
import type { TextFieldProps as BaseTextFieldProps, ValidationResult } from 'react-aria-components';
|
|
4
|
+
interface TextFieldProps extends BaseTextFieldProps, TextFieldVariantProps {
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
description?: string | ReactNode;
|
|
8
|
+
errorMessage?: string | ((validation: ValidationResult) => string);
|
|
9
|
+
}
|
|
10
|
+
declare const TextField: import("react").ForwardRefExoticComponent<TextFieldProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
2
11
|
export { TextField };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var x=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var q=(i,e)=>{for(var d in e)x(i,d,{get:e[d],enumerable:!0})},V=(i,e,d,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of N(e))!h.call(i,a)&&a!==d&&x(i,a,{get:()=>e[a],enumerable:!(l=E(e,a))||l.enumerable});return i};var I=i=>V(x({},"__esModule",{value:!0}),i);var z={};q(z,{TextField:()=>R});module.exports=I(z);var r=require("react/jsx-runtime"),s=require("react-aria-components"),p=require("../utils/cn.js"),T=require("../variants/index.js"),o=require("./index.js"),v=require("../variants/field-error.js"),F=require("@react-aria/utils"),y=require("react-aria"),m=require("react"),P=require("../utils/helpers.js");function O({label:i,description:e,errorMessage:d,size:l="medium",roundness:a="medium",elevation:f="medium",...t},u){[t,u]=(0,s.useContextProps)(t,u,s.TextFieldContext);let c=(0,m.useRef)(null),{labelProps:g,inputProps:b,descriptionProps:w,errorMessageProps:D,...n}=(0,y.useTextField)({...(0,P.removeDataAttributes)(t),inputElementType:"input",label:i},c);return(0,r.jsxs)(o.Flex,{...(0,F.filterDOMProps)(t),gap:2,direction:"column",ref:u,slot:t.slot||void 0,"data-disabled":t.isDisabled||void 0,"data-invalid":n.isInvalid||void 0,"data-readonly":t.isReadOnly||void 0,"data-required":t.isRequired||void 0,children:[i&&(0,r.jsx)(o.Text,{...g,size:1,transform:"uppercase",weight:"semibold",variant:"tertiary",color:"gray",children:i}),(0,r.jsxs)("div",{role:"group",className:"relative","data-radius":a,"data-shadow":f,children:[(0,r.jsx)("input",{...b,ref:c,className:(0,p.cn)("dx","w-full",(0,T.textField)({size:l,roundness:a,elevation:f})),"data-disabled":t.isDisabled||void 0,"data-invalid":n.isInvalid||void 0,"data-readonly":t.isReadOnly||void 0,"data-required":t.isRequired||void 0}),n.isInvalid&&(0,r.jsx)(o.Text,{...D,size:1,className:(0,p.cn)("dx",(0,v.fieldError)({size:l,roundness:a,elevation:f})),children:d?typeof d=="string"?d:d(n):n.validationErrors.length===0?void 0:n.validationErrors.join(" ")})]}),e&&(0,r.jsx)(o.Text,{size:1,variant:"tertiary",...w,children:e})]})}const R=(0,m.forwardRef)(O);
|
|
2
2
|
//# sourceMappingURL=text-field.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/text-field.tsx"],
|
|
4
|
-
"sourcesContent": ["import
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,eAAAE,IAAA,eAAAC,EAAAH,
|
|
6
|
-
"names": ["text_field_exports", "__export", "TextField", "__toCommonJS", "import_jsx_runtime", "import_react"]
|
|
4
|
+
"sourcesContent": ["import { useContextProps, TextFieldContext } from 'react-aria-components';\nimport { cn } from '../utils/cn.js';\nimport { textField } from '../variants/index.js';\nimport { Flex, Text } from './index.js';\nimport { fieldError } from '../variants/field-error.js';\nimport { filterDOMProps } from '@react-aria/utils';\nimport { useTextField } from 'react-aria';\nimport { forwardRef, useRef, type ReactNode } from 'react';\nimport { removeDataAttributes } from '../utils/helpers.js';\n\nimport type { TextFieldVariantProps } from '../variants/index.js';\nimport type { TextFieldProps as BaseTextFieldProps, ValidationResult } from 'react-aria-components';\n\ninterface TextFieldProps extends BaseTextFieldProps, TextFieldVariantProps {\n placeholder?: string;\n label?: string;\n description?: string | ReactNode;\n errorMessage?: string | ((validation: ValidationResult) => string);\n}\n\nfunction _TextField(\n {\n label,\n description,\n errorMessage,\n size = 'medium',\n roundness = 'medium',\n elevation = 'medium',\n ...props\n }: TextFieldProps,\n ref: React.ForwardedRef<HTMLDivElement>,\n) {\n [props, ref] = useContextProps(props, ref, TextFieldContext);\n let inputRef = useRef(null);\n\n let { labelProps, inputProps, descriptionProps, errorMessageProps, ...validation } =\n useTextField<any>(\n {\n ...removeDataAttributes(props),\n inputElementType: 'input',\n label,\n },\n inputRef,\n );\n\n return (\n <Flex\n {...filterDOMProps(props)}\n gap={2}\n direction=\"column\"\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={validation.isInvalid || undefined}\n data-readonly={props.isReadOnly || undefined}\n data-required={props.isRequired || undefined}\n >\n {label && (\n <Text\n {...labelProps}\n size={1}\n transform=\"uppercase\"\n weight=\"semibold\"\n variant=\"tertiary\"\n color=\"gray\"\n >\n {label}\n </Text>\n )}\n <div role=\"group\" className=\"relative\" data-radius={roundness} data-shadow={elevation}>\n <input\n {...inputProps}\n ref={inputRef}\n className={cn('dx', 'w-full', textField({ size, roundness, elevation }))}\n data-disabled={props.isDisabled || undefined}\n data-invalid={validation.isInvalid || undefined}\n data-readonly={props.isReadOnly || undefined}\n data-required={props.isRequired || undefined}\n />\n {validation.isInvalid && (\n <Text\n {...errorMessageProps}\n size={1}\n className={cn('dx', fieldError({ size, roundness, elevation }))}\n >\n {errorMessage\n ? typeof errorMessage === 'string'\n ? errorMessage\n : errorMessage(validation)\n : validation.validationErrors.length === 0\n ? undefined\n : validation.validationErrors.join(' ')}\n </Text>\n )}\n </div>\n {description && (\n <Text size={1} variant=\"tertiary\" {...descriptionProps}>\n {description}\n </Text>\n )}\n </Flex>\n );\n}\n\nconst TextField = forwardRef(_TextField);\n\nexport { TextField };\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,eAAAE,IAAA,eAAAC,EAAAH,GA0DQ,IAAAI,EAAA,6BA1DRC,EAAkD,iCAClDC,EAAmB,0BACnBC,EAA0B,gCAC1BC,EAA2B,sBAC3BC,EAA2B,sCAC3BC,EAA+B,6BAC/BC,EAA6B,sBAC7BC,EAAmD,iBACnDC,EAAqC,+BAYrC,SAASC,EACP,CACE,MAAAC,EACA,YAAAC,EACA,aAAAC,EACA,KAAAC,EAAO,SACP,UAAAC,EAAY,SACZ,UAAAC,EAAY,SACZ,GAAGC,CACL,EACAC,EACA,CACA,CAACD,EAAOC,CAAG,KAAI,mBAAgBD,EAAOC,EAAK,kBAAgB,EAC3D,IAAIC,KAAW,UAAO,IAAI,EAEtB,CAAE,WAAAC,EAAY,WAAAC,EAAY,iBAAAC,EAAkB,kBAAAC,EAAmB,GAAGC,CAAW,KAC/E,gBACE,CACE,MAAG,wBAAqBP,CAAK,EAC7B,iBAAkB,QAClB,MAAAN,CACF,EACAQ,CACF,EAEF,SACE,QAAC,QACE,MAAG,kBAAeF,CAAK,EACxB,IAAK,EACL,UAAU,SACV,IAAKC,EACL,KAAMD,EAAM,MAAQ,OACpB,gBAAeA,EAAM,YAAc,OACnC,eAAcO,EAAW,WAAa,OACtC,gBAAeP,EAAM,YAAc,OACnC,gBAAeA,EAAM,YAAc,OAElC,UAAAN,MACC,OAAC,QACE,GAAGS,EACJ,KAAM,EACN,UAAU,YACV,OAAO,WACP,QAAQ,WACR,MAAM,OAEL,SAAAT,EACH,KAEF,QAAC,OAAI,KAAK,QAAQ,UAAU,WAAW,cAAaI,EAAW,cAAaC,EAC1E,oBAAC,SACE,GAAGK,EACJ,IAAKF,EACL,aAAW,MAAG,KAAM,YAAU,aAAU,CAAE,KAAAL,EAAM,UAAAC,EAAW,UAAAC,CAAU,CAAC,CAAC,EACvE,gBAAeC,EAAM,YAAc,OACnC,eAAcO,EAAW,WAAa,OACtC,gBAAeP,EAAM,YAAc,OACnC,gBAAeA,EAAM,YAAc,OACrC,EACCO,EAAW,cACV,OAAC,QACE,GAAGD,EACJ,KAAM,EACN,aAAW,MAAG,QAAM,cAAW,CAAE,KAAAT,EAAM,UAAAC,EAAW,UAAAC,CAAU,CAAC,CAAC,EAE7D,SAAAH,EACG,OAAOA,GAAiB,SACtBA,EACAA,EAAaW,CAAU,EACzBA,EAAW,iBAAiB,SAAW,EACrC,OACAA,EAAW,iBAAiB,KAAK,GAAG,EAC5C,GAEJ,EACCZ,MACC,OAAC,QAAK,KAAM,EAAG,QAAQ,WAAY,GAAGU,EACnC,SAAAV,EACH,GAEJ,CAEJ,CAEA,MAAMd,KAAY,cAAWY,CAAU",
|
|
6
|
+
"names": ["text_field_exports", "__export", "TextField", "__toCommonJS", "import_jsx_runtime", "import_react_aria_components", "import_cn", "import_variants", "import_index", "import_field_error", "import_utils", "import_react_aria", "import_react", "import_helpers", "_TextField", "label", "description", "errorMessage", "size", "roundness", "elevation", "props", "ref", "inputRef", "labelProps", "inputProps", "descriptionProps", "errorMessageProps", "validation"]
|
|
7
7
|
}
|
|
@@ -16,5 +16,5 @@ type TextPProps = {
|
|
|
16
16
|
as: 'p';
|
|
17
17
|
} & React.HTMLAttributes<HTMLParagraphElement>;
|
|
18
18
|
type TextProps = TextOwnProps & (TextSpanProps | TextDivProps | TextLabelProps | TextPProps);
|
|
19
|
-
declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<
|
|
19
|
+
declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<HTMLElement>>;
|
|
20
20
|
export { Text };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var f=Object.create;var
|
|
1
|
+
"use strict";var f=Object.create;var n=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var C=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var g=(t,e)=>{for(var a in e)n(t,a,{get:e[a],enumerable:!0})},i=(t,e,a,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of u(e))!R.call(t,r)&&r!==a&&n(t,r,{get:()=>e[r],enumerable:!(s=y(e,r))||s.enumerable});return t};var h=(t,e,a)=>(a=t!=null?f(C(t)):{},i(e||!t||!t.__esModule?n(a,"default",{value:t,enumerable:!0}):a,t)),E=t=>i(n({},"__esModule",{value:!0}),t);var S={};g(S,{Text:()=>T});module.exports=E(S);var p=require("react/jsx-runtime"),o=require("react-aria-components"),x=h(require("react")),l=require("@radix-ui/react-slot"),P=require("../variants/text.js");const T=x.default.forwardRef((t,e)=>{[t,e]=(0,o.useContextProps)(t,e,o.TextContext);const{as:a="span",asChild:s,children:r,className:m,size:L,align:c,color:b,variant:d,weight:v,transform:H,...M}=t;return(0,p.jsx)(o.TextContext.Provider,{value:t,children:(0,p.jsx)(l.Slot,{className:(0,P.text)({className:m,size:L,align:c,color:b,variant:d,weight:v,transform:H}),ref:e,...M,children:s?r:(0,p.jsx)(a,{children:r})})})});T.displayName="Text";
|
|
2
2
|
//# sourceMappingURL=text.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/text.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\n\nimport { text } from '../variants/text.js';\n\nimport type { TextVariantProps } from '../variants/text.js';\n\ninterface TextOwnProps extends TextVariantProps {\n asChild?: boolean;\n}\n\ntype TextSpanProps = { as?: 'span' } & React.HTMLAttributes<HTMLSpanElement>;\ntype TextDivProps = { as: 'div' } & React.HTMLAttributes<HTMLDivElement>;\ntype TextLabelProps = { as: 'label' } & React.HTMLAttributes<HTMLLabelElement>;\ntype TextPProps = { as: 'p' } & React.HTMLAttributes<HTMLParagraphElement>;\n\ntype TextProps = TextOwnProps & (TextSpanProps | TextDivProps | TextLabelProps | TextPProps);\n\nconst Text = React.forwardRef<
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,IAAA,eAAAC,EAAAH,
|
|
6
|
-
"names": ["text_exports", "__export", "Text", "__toCommonJS", "import_jsx_runtime", "import_react", "import_react_slot", "import_text", "React", "props", "ref", "Tag", "asChild", "children", "className", "size", "align", "color", "variant", "weight", "rest"]
|
|
4
|
+
"sourcesContent": ["import { useContextProps, LinkContext, TextContext } from 'react-aria-components';\nimport React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\n\nimport { text } from '../variants/text.js';\n\nimport type { TextVariantProps } from '../variants/text.js';\n\ninterface TextOwnProps extends TextVariantProps {\n asChild?: boolean;\n}\n\ntype TextSpanProps = { as?: 'span' } & React.HTMLAttributes<HTMLSpanElement>;\ntype TextDivProps = { as: 'div' } & React.HTMLAttributes<HTMLDivElement>;\ntype TextLabelProps = { as: 'label' } & React.HTMLAttributes<HTMLLabelElement>;\ntype TextPProps = { as: 'p' } & React.HTMLAttributes<HTMLParagraphElement>;\n\ntype TextProps = TextOwnProps & (TextSpanProps | TextDivProps | TextLabelProps | TextPProps);\n\nconst Text = React.forwardRef<HTMLElement, TextProps>((props, ref) => {\n [props, ref] = useContextProps(props, ref, TextContext);\n const {\n as: Tag = 'span',\n asChild,\n children,\n className,\n size,\n align,\n color,\n variant,\n weight,\n transform,\n ...rest\n } = props;\n\n return (\n <TextContext.Provider value={props}>\n <Slot\n className={text({ className, size, align, color, variant, weight, transform })}\n ref={ref}\n {...rest}\n >\n {asChild ? children : <Tag>{children}</Tag>}\n </Slot>\n </TextContext.Provider>\n );\n});\n\nText.displayName = 'Text';\n\nexport { Text };\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,IAAA,eAAAC,EAAAH,GA0C8B,IAAAI,EAAA,6BA1C9BC,EAA0D,iCAC1DC,EAAkB,oBAClBC,EAAqB,gCAErBC,EAAqB,+BAerB,MAAMN,EAAO,EAAAO,QAAM,WAAmC,CAACC,EAAOC,IAAQ,CACpE,CAACD,EAAOC,CAAG,KAAI,mBAAgBD,EAAOC,EAAK,aAAW,EACtD,KAAM,CACJ,GAAIC,EAAM,OACV,QAAAC,EACA,SAAAC,EACA,UAAAC,EACA,KAAAC,EACA,MAAAC,EACA,MAAAC,EACA,QAAAC,EACA,OAAAC,EACA,UAAAC,EACA,GAAGC,CACL,EAAIZ,EAEJ,SACE,OAAC,cAAY,SAAZ,CAAqB,MAAOA,EAC3B,mBAAC,QACC,aAAW,QAAK,CAAE,UAAAK,EAAW,KAAAC,EAAM,MAAAC,EAAO,MAAAC,EAAO,QAAAC,EAAS,OAAAC,EAAQ,UAAAC,CAAU,CAAC,EAC7E,IAAKV,EACJ,GAAGW,EAEH,SAAAT,EAAUC,KAAW,OAACF,EAAA,CAAK,SAAAE,EAAS,EACvC,EACF,CAEJ,CAAC,EAEDZ,EAAK,YAAc",
|
|
6
|
+
"names": ["text_exports", "__export", "Text", "__toCommonJS", "import_jsx_runtime", "import_react_aria_components", "import_react", "import_react_slot", "import_text", "React", "props", "ref", "Tag", "asChild", "children", "className", "size", "align", "color", "variant", "weight", "transform", "rest"]
|
|
7
7
|
}
|
|
@@ -4,8 +4,10 @@ interface ThemeContext {
|
|
|
4
4
|
negativeBaseColor?: string;
|
|
5
5
|
grayBaseColor?: string;
|
|
6
6
|
roundness?: 'none' | 'small' | 'medium' | 'large' | 'full';
|
|
7
|
+
elevation?: 'none' | 'small' | 'medium' | 'large';
|
|
7
8
|
density?: number;
|
|
8
9
|
contrast?: number;
|
|
10
|
+
chroma?: number;
|
|
9
11
|
mode?: 'light' | 'dark';
|
|
10
12
|
}
|
|
11
13
|
interface ThemeProps extends ThemeContext, React.HTMLAttributes<HTMLDivElement> {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var P=Object.create;var s=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var k=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var E=(o,t)=>{for(var e in t)s(o,e,{get:t[e],enumerable:!0})},f=(o,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of D(t))!w.call(o,r)&&r!==e&&s(o,r,{get:()=>t[r],enumerable:!(n=R(t,r))||n.enumerable});return o};var H=(o,t,e)=>(e=o!=null?P(k(o)):{},f(t||!o||!o.__esModule?s(e,"default",{value:o,enumerable:!0}):e,o)),L=o=>f(s({},"__esModule",{value:!0}),o);var M={};E(M,{Theme:()=>m});module.exports=L(M);var a=require("react/jsx-runtime"),y=require("@radix-ui/react-slot"),i=H(require("react")),T=require("@radix-ui/react-tooltip"),B=require("@radix-ui/react-direction");const p=i.createContext({accentBaseColor:void 0,negativeBaseColor:"oklch(0% 0 20)",grayBaseColor:void 0,roundness:"medium",elevation:"medium",density:1,contrast:1,mode:"light",chroma:1}),m=i.forwardRef((o,t)=>{const e=i.useContext(p),{asChild:n,accentBaseColor:r=e.accentBaseColor,negativeBaseColor:d=e.negativeBaseColor,grayBaseColor:l=e.grayBaseColor,roundness:c=e.roundness,elevation:h=e.elevation,density:C=e.density,contrast:u=e.contrast,mode:v=e.mode,chroma:g=e.chroma,...x}=o,b=n?y.Slot:"div";return(0,a.jsx)(T.TooltipProvider,{delayDuration:200,children:(0,a.jsx)(B.DirectionProvider,{dir:"ltr",children:(0,a.jsx)(p.Provider,{value:{accentBaseColor:r,negativeBaseColor:d,grayBaseColor:l,roundness:c,elevation:h,density:C,contrast:u,mode:v,chroma:g},children:(0,a.jsx)(b,{...x,className:"dx "+v,ref:t,style:{"--accent-base":r,"--negative-base":d,"--gray-base":l,"--base-density":C,"--contrast-factor":u,"--chroma-factor":g},"data-radius":c,"data-shadow":h})})})})});m.displayName="Theme";
|
|
2
2
|
//# sourceMappingURL=theme.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/theme.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Slot } from '@radix-ui/react-slot';\nimport * as React from 'react';\nimport { TooltipProvider } from '@radix-ui/react-tooltip';\nimport { DirectionProvider } from '@radix-ui/react-direction';\n\ninterface ThemeContext {\n accentBaseColor?: string;\n negativeBaseColor?: string;\n grayBaseColor?: string;\n roundness?: 'none' | 'small' | 'medium' | 'large' | 'full';\n density?: number;\n contrast?: number;\n mode?: 'light' | 'dark';\n}\n\ninterface ThemeProps extends ThemeContext, React.HTMLAttributes<HTMLDivElement> {\n asChild?: boolean;\n}\n\nconst ThemeContext = React.createContext<ThemeContext>({\n accentBaseColor: undefined,\n negativeBaseColor:
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,IAAA,eAAAC,EAAAH,
|
|
6
|
-
"names": ["theme_exports", "__export", "Theme", "__toCommonJS", "import_jsx_runtime", "import_react_slot", "React", "import_react_tooltip", "import_react_direction", "ThemeContext", "props", "ref", "parentTheme", "asChild", "accentBaseColor", "negativeBaseColor", "grayBaseColor", "roundness", "density", "contrast", "mode", "rest", "Comp"]
|
|
4
|
+
"sourcesContent": ["import { Slot } from '@radix-ui/react-slot';\nimport * as React from 'react';\nimport { TooltipProvider } from '@radix-ui/react-tooltip';\nimport { DirectionProvider } from '@radix-ui/react-direction';\n\ninterface ThemeContext {\n accentBaseColor?: string;\n negativeBaseColor?: string;\n grayBaseColor?: string;\n roundness?: 'none' | 'small' | 'medium' | 'large' | 'full';\n elevation?: 'none' | 'small' | 'medium' | 'large';\n density?: number;\n contrast?: number;\n chroma?: number;\n mode?: 'light' | 'dark';\n}\n\ninterface ThemeProps extends ThemeContext, React.HTMLAttributes<HTMLDivElement> {\n asChild?: boolean;\n}\n\nconst ThemeContext = React.createContext<ThemeContext>({\n accentBaseColor: undefined,\n negativeBaseColor: 'oklch(0% 0 20)',\n grayBaseColor: undefined,\n roundness: 'medium',\n elevation: 'medium',\n density: 1,\n contrast: 1,\n mode: 'light',\n chroma: 1,\n});\n\nconst Theme = React.forwardRef<React.ElementRef<'div'>, ThemeProps>((props, ref) => {\n const parentTheme = React.useContext(ThemeContext);\n const {\n asChild,\n accentBaseColor = parentTheme.accentBaseColor,\n negativeBaseColor = parentTheme.negativeBaseColor,\n grayBaseColor = parentTheme.grayBaseColor,\n roundness = parentTheme.roundness,\n elevation = parentTheme.elevation,\n density = parentTheme.density,\n contrast = parentTheme.contrast,\n mode = parentTheme.mode,\n chroma = parentTheme.chroma,\n ...rest\n } = props;\n\n const Comp = asChild ? Slot : 'div';\n return (\n <TooltipProvider delayDuration={200}>\n <DirectionProvider dir=\"ltr\">\n <ThemeContext.Provider\n value={{\n accentBaseColor,\n negativeBaseColor,\n grayBaseColor,\n roundness,\n elevation,\n density,\n contrast,\n mode,\n chroma,\n }}\n >\n <Comp\n {...rest}\n className={'dx ' + mode}\n ref={ref}\n style={\n {\n '--accent-base': accentBaseColor,\n '--negative-base': negativeBaseColor,\n '--gray-base': grayBaseColor,\n '--base-density': density,\n '--contrast-factor': contrast,\n '--chroma-factor': chroma,\n } as any\n }\n data-radius={roundness}\n data-shadow={elevation}\n />\n </ThemeContext.Provider>\n </DirectionProvider>\n </TooltipProvider>\n );\n});\n\nTheme.displayName = 'Theme';\n\nexport { Theme };\nexport type { ThemeProps };\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,IAAA,eAAAC,EAAAH,GAkEU,IAAAI,EAAA,6BAlEVC,EAAqB,gCACrBC,EAAuB,oBACvBC,EAAgC,mCAChCC,EAAkC,qCAkBlC,MAAMC,EAAeH,EAAM,cAA4B,CACrD,gBAAiB,OACjB,kBAAmB,iBACnB,cAAe,OACf,UAAW,SACX,UAAW,SACX,QAAS,EACT,SAAU,EACV,KAAM,QACN,OAAQ,CACV,CAAC,EAEKJ,EAAQI,EAAM,WAAgD,CAACI,EAAOC,IAAQ,CAClF,MAAMC,EAAcN,EAAM,WAAWG,CAAY,EAC3C,CACJ,QAAAI,EACA,gBAAAC,EAAkBF,EAAY,gBAC9B,kBAAAG,EAAoBH,EAAY,kBAChC,cAAAI,EAAgBJ,EAAY,cAC5B,UAAAK,EAAYL,EAAY,UACxB,UAAAM,EAAYN,EAAY,UACxB,QAAAO,EAAUP,EAAY,QACtB,SAAAQ,EAAWR,EAAY,SACvB,KAAAS,EAAOT,EAAY,KACnB,OAAAU,EAASV,EAAY,OACrB,GAAGW,CACL,EAAIb,EAEEc,EAAOX,EAAU,OAAO,MAC9B,SACE,OAAC,mBAAgB,cAAe,IAC9B,mBAAC,qBAAkB,IAAI,MACrB,mBAACJ,EAAa,SAAb,CACC,MAAO,CACL,gBAAAK,EACA,kBAAAC,EACA,cAAAC,EACA,UAAAC,EACA,UAAAC,EACA,QAAAC,EACA,SAAAC,EACA,KAAAC,EACA,OAAAC,CACF,EAEA,mBAACE,EAAA,CACE,GAAGD,EACJ,UAAW,MAAQF,EACnB,IAAKV,EACL,MACE,CACE,gBAAiBG,EACjB,kBAAmBC,EACnB,cAAeC,EACf,iBAAkBG,EAClB,oBAAqBC,EACrB,kBAAmBE,CACrB,EAEF,cAAaL,EACb,cAAaC,EACf,EACF,EACF,EACF,CAEJ,CAAC,EAEDhB,EAAM,YAAc",
|
|
6
|
+
"names": ["theme_exports", "__export", "Theme", "__toCommonJS", "import_jsx_runtime", "import_react_slot", "React", "import_react_tooltip", "import_react_direction", "ThemeContext", "props", "ref", "parentTheme", "asChild", "accentBaseColor", "negativeBaseColor", "grayBaseColor", "roundness", "elevation", "density", "contrast", "mode", "chroma", "rest", "Comp"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var y=Object.create;var n=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var N=(o,t)=>{for(var e in t)n(o,e,{get:t[e],enumerable:!0})},T=(o,t,e,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of h(t))!x.call(o,r)&&r!==e&&n(o,r,{get:()=>t[r],enumerable:!(l=C(t,r))||l.enumerable});return o};var f=(o,t,e)=>(e=o!=null?y(v(o)):{},T(t||!o||!o.__esModule?n(e,"default",{value:o,enumerable:!0}):e,o)),u=o=>T(n({},"__esModule",{value:!0}),o);var E={};N(E,{Content:()=>m,Root:()=>a,Trigger:()=>s});module.exports=u(E);var i=require("react/jsx-runtime"),c=f(require("react")),p=f(require("@radix-ui/react-tooltip")),g=require("@radix-ui/react-slot"),P=require("./text.js"),R=require("./theme.js");const a=o=>(0,i.jsx)(p.Root,{...o});a.displayName="Tooltip.Root";const s=c.forwardRef(({children:o,...t},e)=>(0,i.jsx)(p.Trigger,{...t,ref:e,asChild:!0,children:(0,i.jsx)(g.Slot,{children:o})}));s.displayName="Tooltip.Trigger";const m=c.forwardRef((o,t)=>{const{content:e,container:l,forceMount:r,...d}=o;return(0,i.jsx)(p.Portal,{container:l,forceMount:r,children:(0,i.jsx)(R.Theme,{asChild:!0,children:(0,i.jsxs)(p.Content,{sideOffset:4,collisionPadding:10,...d,asChild:!1,ref:t,className:"rounded-sm bg-gray-600 py-2 px-4 shadow-md shadow-gray-400/30",children:[(0,i.jsx)(P.Text,{className:"text-bg",as:"p",size:1,children:e}),(0,i.jsx)(p.Arrow,{className:"fill-gray-600"})]})})})});m.displayName="Tooltip.Content";
|
|
2
2
|
//# sourceMappingURL=tooltip.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/tooltip.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip';\nimport { Slot } from '@radix-ui/react-slot';\n\nimport { Text } from './text.js';\nimport { Theme } from './theme.js';\n\ntype TooltipElement = React.ElementRef<typeof TooltipPrimitive.Content>;\n\ninterface TooltipRootProps extends React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Root> {}\nconst TooltipRoot: React.FC<TooltipRootProps> = (props: TooltipRootProps) => (\n <TooltipPrimitive.Root {...props} />\n);\nTooltipRoot.displayName = 'Tooltip.Root';\n\ntype TooltipTriggerElement = React.ElementRef<typeof TooltipPrimitive.Trigger>;\ninterface TooltipTriggerProps extends React.PropsWithChildren<{}> {}\nconst TooltipTrigger = React.forwardRef<TooltipTriggerElement, TooltipTriggerProps>(\n ({ children, ...rest }, ref) => (\n <TooltipPrimitive.Trigger {...rest} ref={ref} asChild>\n <Slot>{children}</Slot>\n </TooltipPrimitive.Trigger>\n ),\n);\nTooltipTrigger.displayName = 'Tooltip.Trigger';\n\ninterface TooltipProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Portal>,\n 'children' | 'className'\n >,\n Omit<\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>,\n 'children' | 'className'\n > {}\nconst TooltipContent = React.forwardRef<TooltipElement, TooltipProps>((props, forwardedRef) => {\n const { content, container, forceMount, ...rest } = props;\n\n return (\n <TooltipPrimitive.Portal container={container} forceMount={forceMount}>\n <Theme asChild>\n <TooltipPrimitive.Content\n sideOffset={4}\n collisionPadding={10}\n {...rest}\n asChild={false}\n ref={forwardedRef}\n className={'rounded-sm bg-gray-600 py-2 px-4 shadow-md shadow-gray-400/30'}\n >\n <Text className=\"text-
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,SAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAL,GAWE,IAAAM,EAAA,6BAXFC,EAAuB,oBACvBC,EAAkC,sCAClCC,EAAqB,gCAErBC,EAAqB,qBACrBC,EAAsB,sBAKtB,MAAMR,EAA2CS,MAC/C,OAACJ,EAAiB,KAAjB,CAAuB,GAAGI,EAAO,EAEpCT,EAAY,YAAc,eAI1B,MAAMC,EAAiBG,EAAM,WAC3B,CAAC,CAAE,SAAAM,EAAU,GAAGC,CAAK,EAAGC,OACtB,OAACP,EAAiB,QAAjB,CAA0B,GAAGM,EAAM,IAAKC,EAAK,QAAO,GACnD,mBAAC,QAAM,SAAAF,EAAS,EAClB,CAEJ,EACAT,EAAe,YAAc,kBAW7B,MAAMF,EAAiBK,EAAM,WAAyC,CAACK,EAAOI,IAAiB,CAC7F,KAAM,CAAE,QAAAC,EAAS,UAAAC,EAAW,WAAAC,EAAY,GAAGL,CAAK,EAAIF,EAEpD,SACE,OAACJ,EAAiB,OAAjB,CAAwB,UAAWU,EAAW,WAAYC,EACzD,mBAAC,SAAM,QAAO,GACZ,oBAACX,EAAiB,QAAjB,CACC,WAAY,EACZ,iBAAkB,GACjB,GAAGM,EACJ,QAAS,GACT,IAAKE,EACL,UAAW,gEAEX,oBAAC,QAAK,UAAU,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip';\nimport { Slot } from '@radix-ui/react-slot';\n\nimport { Text } from './text.js';\nimport { Theme } from './theme.js';\n\ntype TooltipElement = React.ElementRef<typeof TooltipPrimitive.Content>;\n\ninterface TooltipRootProps extends React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Root> {}\nconst TooltipRoot: React.FC<TooltipRootProps> = (props: TooltipRootProps) => (\n <TooltipPrimitive.Root {...props} />\n);\nTooltipRoot.displayName = 'Tooltip.Root';\n\ntype TooltipTriggerElement = React.ElementRef<typeof TooltipPrimitive.Trigger>;\ninterface TooltipTriggerProps extends React.PropsWithChildren<{}> {}\nconst TooltipTrigger = React.forwardRef<TooltipTriggerElement, TooltipTriggerProps>(\n ({ children, ...rest }, ref) => (\n <TooltipPrimitive.Trigger {...rest} ref={ref} asChild>\n <Slot>{children}</Slot>\n </TooltipPrimitive.Trigger>\n ),\n);\nTooltipTrigger.displayName = 'Tooltip.Trigger';\n\ninterface TooltipProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Portal>,\n 'children' | 'className'\n >,\n Omit<\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>,\n 'children' | 'className'\n > {}\nconst TooltipContent = React.forwardRef<TooltipElement, TooltipProps>((props, forwardedRef) => {\n const { content, container, forceMount, ...rest } = props;\n\n return (\n <TooltipPrimitive.Portal container={container} forceMount={forceMount}>\n <Theme asChild>\n <TooltipPrimitive.Content\n sideOffset={4}\n collisionPadding={10}\n {...rest}\n asChild={false}\n ref={forwardedRef}\n className={'rounded-sm bg-gray-600 py-2 px-4 shadow-md shadow-gray-400/30'}\n >\n <Text className=\"text-bg\" as=\"p\" size={1}>\n {content}\n </Text>\n <TooltipPrimitive.Arrow className=\"fill-gray-600\" />\n </TooltipPrimitive.Content>\n </Theme>\n </TooltipPrimitive.Portal>\n );\n});\nTooltipContent.displayName = 'Tooltip.Content';\n\nexport { TooltipContent as Content, TooltipRoot as Root, TooltipTrigger as Trigger };\nexport type { TooltipProps };\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,SAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAL,GAWE,IAAAM,EAAA,6BAXFC,EAAuB,oBACvBC,EAAkC,sCAClCC,EAAqB,gCAErBC,EAAqB,qBACrBC,EAAsB,sBAKtB,MAAMR,EAA2CS,MAC/C,OAACJ,EAAiB,KAAjB,CAAuB,GAAGI,EAAO,EAEpCT,EAAY,YAAc,eAI1B,MAAMC,EAAiBG,EAAM,WAC3B,CAAC,CAAE,SAAAM,EAAU,GAAGC,CAAK,EAAGC,OACtB,OAACP,EAAiB,QAAjB,CAA0B,GAAGM,EAAM,IAAKC,EAAK,QAAO,GACnD,mBAAC,QAAM,SAAAF,EAAS,EAClB,CAEJ,EACAT,EAAe,YAAc,kBAW7B,MAAMF,EAAiBK,EAAM,WAAyC,CAACK,EAAOI,IAAiB,CAC7F,KAAM,CAAE,QAAAC,EAAS,UAAAC,EAAW,WAAAC,EAAY,GAAGL,CAAK,EAAIF,EAEpD,SACE,OAACJ,EAAiB,OAAjB,CAAwB,UAAWU,EAAW,WAAYC,EACzD,mBAAC,SAAM,QAAO,GACZ,oBAACX,EAAiB,QAAjB,CACC,WAAY,EACZ,iBAAkB,GACjB,GAAGM,EACJ,QAAS,GACT,IAAKE,EACL,UAAW,gEAEX,oBAAC,QAAK,UAAU,UAAU,GAAG,IAAI,KAAM,EACpC,SAAAC,EACH,KACA,OAACT,EAAiB,MAAjB,CAAuB,UAAU,gBAAgB,GACpD,EACF,EACF,CAEJ,CAAC,EACDN,EAAe,YAAc",
|
|
6
6
|
"names": ["tooltip_exports", "__export", "TooltipContent", "TooltipRoot", "TooltipTrigger", "__toCommonJS", "import_jsx_runtime", "React", "TooltipPrimitive", "import_react_slot", "import_text", "import_theme", "props", "children", "rest", "ref", "forwardedRef", "content", "container", "forceMount"]
|
|
7
7
|
}
|
package/dist/cjs/hooks/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var m=Object.create;var s=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var c=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var i=(e,r)=>{for(var a in r)s(e,a,{get:r[a],enumerable:!0})},f=(e,r,a,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of P(r))!h.call(e,o)&&o!==a&&s(e,o,{get:()=>r[o],enumerable:!(u=x(r,o))||u.enumerable});return e};var t=(e,r,a)=>(a=e!=null?m(c(e)):{},f(r||!e||!e.__esModule?s(a,"default",{value:e,enumerable:!0}):a,e)),n=e=>f(s({},"__esModule",{value:!0}),e);var v={};i(v,{useDashXProvider:()=>d.default,useInApp:()=>p.default,useProductRelease:()=>l.default});module.exports=n(v);var d=t(require("./use-dashx-provider.js")),p=t(require("./use-in-app.js")),l=t(require("./use-product-release.js"));
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/hooks/index.ts"],
|
|
4
|
-
"sourcesContent": ["export { default as useDashXProvider } from './use-dashx-provider.js';\nexport { default as useInApp } from './use-in-app.js';\n"],
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,
|
|
6
|
-
"names": ["hooks_exports", "__export", "__toCommonJS", "import_use_dashx_provider", "import_use_in_app"]
|
|
4
|
+
"sourcesContent": ["export { default as useDashXProvider } from './use-dashx-provider.js';\nexport { default as useInApp } from './use-in-app.js';\nexport { default as useProductRelease } from './use-product-release.js';\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wGAAAE,EAAAF,GAAA,IAAAG,EAA4C,sCAC5CC,EAAoC,8BACpCC,EAA6C",
|
|
6
|
+
"names": ["hooks_exports", "__export", "__toCommonJS", "import_use_dashx_provider", "import_use_in_app", "import_use_product_release"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var I=Object.create;var
|
|
1
|
+
"use strict";var I=Object.create;var r=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var l=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var R=(t,o)=>{for(var i in o)r(t,i,{get:o[i],enumerable:!0})},p=(t,o,i,e)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of y(o))!h.call(t,s)&&s!==i&&r(t,s,{get:()=>o[s],enumerable:!(e=g(o,s))||e.enumerable});return t};var f=(t,o,i)=>(i=t!=null?I(l(t)):{},p(o||!t||!t.__esModule?r(i,"default",{value:t,enumerable:!0}):i,t)),U=t=>p(r({},"__esModule",{value:!0}),t);var T={};R(T,{default:()=>P});module.exports=U(T);var u=f(require("react-hot-toast")),n=require("react"),m=require("@dashx/browser"),N=f(require("./use-dashx-provider.js")),d=require("../providers/DashXProvider.js");const C=()=>{let t=(0,N.default)();const{subscribe:o}=(0,d.useWebSocket)(),[i,e]=(0,n.useState)([]),[s,A]=(0,n.useState)(null),b=a=>t.trackNotification({id:a,status:"READ"}),k=async a=>t.trackNotification({id:a,status:"UNREAD"});return(0,n.useEffect)(()=>{t.watchFetchInAppNotifications(e),t.watchFetchInAppNotificationsAggregate(A)},[t]),(0,n.useEffect)(()=>o(c=>{c?.type===m.WebsocketMessage.IN_APP_NOTIFICATION&&(0,u.default)(c.data.renderedContent.body)}),[o]),{notifications:i,unreadNotificationsCount:s,markNotificationAsRead:b,markNotificationAsUnread:k}};var P=C;
|
|
2
2
|
//# sourceMappingURL=use-in-app.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/hooks/use-in-app.ts"],
|
|
4
|
-
"sourcesContent": ["import
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,
|
|
6
|
-
"names": ["use_in_app_exports", "__export", "use_in_app_default", "__toCommonJS", "
|
|
4
|
+
"sourcesContent": ["import toast from 'react-hot-toast';\nimport { useEffect, useState } from 'react';\nimport { WebsocketMessage } from '@dashx/browser';\nimport type { InAppNotifications, WebsocketMessageType } from '@dashx/browser';\n\nimport useDashXProvider from './use-dashx-provider.js';\nimport { useWebSocket } from '../providers/DashXProvider.js';\n\ntype UseInAppHookResponse = {\n notifications: InAppNotifications;\n unreadNotificationsCount: number | null;\n markNotificationAsRead: (id: string) => Promise<any>;\n markNotificationAsUnread: (id: string) => Promise<any>;\n};\n\nconst useInApp = (): UseInAppHookResponse => {\n let dashX = useDashXProvider();\n const { subscribe } = useWebSocket();\n const [notifications, setNotifications] = useState<InAppNotifications>([]);\n const [unreadNotificationsCount, setUnreadNotificationsCount] = useState<number | null>(null);\n\n const markNotificationAsRead = (id: string) => dashX.trackNotification({ id, status: 'READ' });\n\n const markNotificationAsUnread = async (id: string) =>\n dashX.trackNotification({ id, status: 'UNREAD' });\n\n\n useEffect(() => {\n // Set up notification watchers (automatically refetch on WebSocket reconnection)\n dashX.watchFetchInAppNotifications(setNotifications);\n dashX.watchFetchInAppNotificationsAggregate(setUnreadNotificationsCount);\n }, [dashX]);\n\n useEffect(() => {\n // Subscribe to WebSocket messages for notifications\n const unsubscribe = subscribe((message: WebsocketMessageType) => {\n // Handle only IN_APP_NOTIFICATION for toast display\n // The client handles all other message processing internally\n if (message?.type === WebsocketMessage.IN_APP_NOTIFICATION) {\n toast(message.data.renderedContent.body);\n }\n });\n\n return unsubscribe;\n }, [subscribe]);\n\n return {\n notifications,\n unreadNotificationsCount,\n markNotificationAsRead,\n markNotificationAsUnread,\n };\n};\n\nexport default useInApp;\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAkB,8BAClBC,EAAoC,iBACpCC,EAAiC,0BAGjCC,EAA6B,sCAC7BC,EAA6B,yCAS7B,MAAMC,EAAW,IAA4B,CAC3C,IAAIC,KAAQ,EAAAC,SAAiB,EAC7B,KAAM,CAAE,UAAAC,CAAU,KAAI,gBAAa,EAC7B,CAACC,EAAeC,CAAgB,KAAI,YAA6B,CAAC,CAAC,EACnE,CAACC,EAA0BC,CAA2B,KAAI,YAAwB,IAAI,EAEtFC,EAA0BC,GAAeR,EAAM,kBAAkB,CAAE,GAAAQ,EAAI,OAAQ,MAAO,CAAC,EAEvFC,EAA2B,MAAOD,GACtCR,EAAM,kBAAkB,CAAE,GAAAQ,EAAI,OAAQ,QAAS,CAAC,EAGlD,sBAAU,IAAM,CAEdR,EAAM,6BAA6BI,CAAgB,EACnDJ,EAAM,sCAAsCM,CAA2B,CACzE,EAAG,CAACN,CAAK,CAAC,KAEV,aAAU,IAEYE,EAAWQ,GAAkC,CAG3DA,GAAS,OAAS,mBAAiB,wBACrC,EAAAC,SAAMD,EAAQ,KAAK,gBAAgB,IAAI,CAE3C,CAAC,EAGA,CAACR,CAAS,CAAC,EAEP,CACL,cAAAC,EACA,yBAAAE,EACA,uBAAAE,EACA,yBAAAE,CACF,CACF,EAEA,IAAOjB,EAAQO",
|
|
6
|
+
"names": ["use_in_app_exports", "__export", "use_in_app_default", "__toCommonJS", "import_react_hot_toast", "import_react", "import_browser", "import_use_dashx_provider", "import_DashXProvider", "useInApp", "dashX", "useDashXProvider", "subscribe", "notifications", "setNotifications", "unreadNotificationsCount", "setUnreadNotificationsCount", "markNotificationAsRead", "id", "markNotificationAsUnread", "message", "toast"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ProductVariantReleaseRule } from '@dashx/browser';
|
|
2
|
+
type UseProductReleaseHookResponse = {
|
|
3
|
+
productVariantReleaseRule: ProductVariantReleaseRule | null;
|
|
4
|
+
};
|
|
5
|
+
declare const useProductRelease: () => UseProductReleaseHookResponse;
|
|
6
|
+
export default useProductRelease;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var d=Object.create;var u=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty;var m=(e,t)=>{for(var s in t)u(e,s,{get:t[s],enumerable:!0})},c=(e,t,s,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of b(t))!f.call(e,r)&&r!==s&&u(e,r,{get:()=>t[r],enumerable:!(o=p(t,r))||o.enumerable});return e};var V=(e,t,s)=>(s=e!=null?d(P(e)):{},c(t||!e||!e.__esModule?u(s,"default",{value:e,enumerable:!0}):s,e)),k=e=>c(u({},"__esModule",{value:!0}),e);var y={};m(y,{default:()=>h});module.exports=k(y);var a=require("react"),R=require("@dashx/browser"),n=V(require("./use-dashx-provider.js")),i=require("../providers/DashXProvider.js");const E=()=>{let e=(0,n.default)();const{subscribe:t}=(0,i.useWebSocket)(),[s,o]=(0,a.useState)(null);return(0,a.useEffect)(()=>{e.watchFetchProductVariantReleaseRule(o)},[e]),(0,a.useEffect)(()=>t(l=>{l?.type===R.WebsocketMessage.PRODUCT_VARIANT_RELEASE_RULE_UPDATED&&o(l.data)}),[t]),{productVariantReleaseRule:s}};var h=E;
|
|
2
|
+
//# sourceMappingURL=use-product-release.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/hooks/use-product-release.ts"],
|
|
4
|
+
"sourcesContent": ["import { useEffect, useState } from 'react';\nimport { WebsocketMessage } from '@dashx/browser';\nimport type { ProductVariantReleaseRule, WebsocketMessageType } from '@dashx/browser';\n\nimport useDashXProvider from './use-dashx-provider.js';\nimport { useWebSocket } from '../providers/DashXProvider.js';\n\ntype UseProductReleaseHookResponse = {\n productVariantReleaseRule: ProductVariantReleaseRule | null;\n};\n\nconst useProductRelease = (): UseProductReleaseHookResponse => {\n let dashX = useDashXProvider();\n const { subscribe } = useWebSocket();\n const [productVariantReleaseRule, setProductVariantReleaseRule] = useState<ProductVariantReleaseRule | null>(null);\n\n useEffect(() => {\n // Set up product variant release rule watcher (automatically refetch on WebSocket reconnection)\n dashX.watchFetchProductVariantReleaseRule(setProductVariantReleaseRule);\n }, [dashX]);\n\n useEffect(() => {\n // Subscribe to WebSocket messages for product variant release updates\n const unsubscribe = subscribe((message: WebsocketMessageType) => {\n if (message?.type === WebsocketMessage.PRODUCT_VARIANT_RELEASE_RULE_UPDATED) {\n setProductVariantReleaseRule(message.data);\n }\n });\n\n return unsubscribe;\n }, [subscribe]);\n\n return {\n productVariantReleaseRule,\n };\n};\n\nexport default useProductRelease;\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAoC,iBACpCC,EAAiC,0BAGjCC,EAA6B,sCAC7BC,EAA6B,yCAM7B,MAAMC,EAAoB,IAAqC,CAC7D,IAAIC,KAAQ,EAAAC,SAAiB,EAC7B,KAAM,CAAE,UAAAC,CAAU,KAAI,gBAAa,EAC7B,CAACC,EAA2BC,CAA4B,KAAI,YAA2C,IAAI,EAEjH,sBAAU,IAAM,CAEdJ,EAAM,oCAAoCI,CAA4B,CACxE,EAAG,CAACJ,CAAK,CAAC,KAEV,aAAU,IAEYE,EAAWG,GAAkC,CAC3DA,GAAS,OAAS,mBAAiB,sCACrCD,EAA6BC,EAAQ,IAAI,CAE7C,CAAC,EAGA,CAACH,CAAS,CAAC,EAEP,CACL,0BAAAC,CACF,CACF,EAEA,IAAOV,EAAQM",
|
|
6
|
+
"names": ["use_product_release_exports", "__export", "use_product_release_default", "__toCommonJS", "import_react", "import_browser", "import_use_dashx_provider", "import_DashXProvider", "useProductRelease", "dashX", "useDashXProvider", "subscribe", "productVariantReleaseRule", "setProductVariantReleaseRule", "message"]
|
|
7
|
+
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { Client, ClientParams } from '@dashx/browser';
|
|
2
|
+
import type { Client, ClientParams, WebsocketMessageType } from '@dashx/browser';
|
|
3
3
|
declare const DashXContext: React.Context<Client | null>;
|
|
4
|
-
|
|
4
|
+
type WebSocketContextType = {
|
|
5
|
+
isConnected: boolean;
|
|
6
|
+
subscribe: (callback: (message: WebsocketMessageType) => void) => () => void;
|
|
7
|
+
};
|
|
8
|
+
declare function DashXProvider({ children, publicKey, baseUri, realtimeBaseUri, targetEnvironment, targetProduct, }: React.PropsWithChildren<ClientParams>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function useWebSocket(): WebSocketContextType;
|
|
5
10
|
export default DashXProvider;
|
|
6
11
|
export { DashXContext };
|