@nild/components 0.0.54 → 0.0.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/dist/color-picker/Area.d.ts +11 -0
  2. package/dist/color-picker/Area.js +1 -0
  3. package/dist/color-picker/ColorPicker.d.ts +6 -0
  4. package/dist/color-picker/ColorPicker.js +1 -0
  5. package/dist/color-picker/DefaultTrigger.d.ts +14 -0
  6. package/dist/color-picker/DefaultTrigger.js +1 -0
  7. package/dist/color-picker/Panel.d.ts +31 -0
  8. package/dist/color-picker/Panel.js +1 -0
  9. package/dist/color-picker/PresetGrid.d.ts +13 -0
  10. package/dist/color-picker/PresetGrid.js +1 -0
  11. package/dist/color-picker/SliderControl.d.ts +19 -0
  12. package/dist/color-picker/SliderControl.js +1 -0
  13. package/dist/color-picker/Swatch.d.ts +8 -0
  14. package/dist/color-picker/Swatch.js +1 -0
  15. package/dist/color-picker/Trigger.d.ts +5 -0
  16. package/dist/color-picker/Trigger.js +1 -0
  17. package/dist/color-picker/ValueControls.d.ts +15 -0
  18. package/dist/color-picker/ValueControls.js +1 -0
  19. package/dist/color-picker/__tests__/ColorPicker.test.d.ts +0 -0
  20. package/dist/color-picker/_shared/checkerboard.d.ts +4 -0
  21. package/dist/color-picker/_shared/checkerboard.js +1 -0
  22. package/dist/color-picker/_shared/color.d.ts +25 -0
  23. package/dist/color-picker/_shared/color.js +1 -0
  24. package/dist/color-picker/hooks/useColorArea.d.ts +20 -0
  25. package/dist/color-picker/hooks/useColorArea.js +1 -0
  26. package/dist/color-picker/hooks/useColorPickerState.d.ts +29 -0
  27. package/dist/color-picker/hooks/useColorPickerState.js +1 -0
  28. package/dist/color-picker/index.d.ts +8 -0
  29. package/dist/color-picker/index.js +1 -0
  30. package/dist/color-picker/interfaces/index.d.ts +42 -0
  31. package/dist/color-picker/style/index.d.ts +39 -0
  32. package/dist/color-picker/style/index.js +1 -0
  33. package/dist/index.d.ts +3 -1
  34. package/dist/index.js +1 -1
  35. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/_prepare.js +1 -0
  36. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/average.js +1 -0
  37. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/colors/named.js +1 -0
  38. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/converter.js +1 -0
  39. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/difference.js +1 -0
  40. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/fixup/alpha.js +1 -0
  41. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/fixup/hue.js +1 -0
  42. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/formatter.js +1 -0
  43. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsl/convertHslToRgb.js +1 -0
  44. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsl/convertRgbToHsl.js +1 -0
  45. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsl/definition.js +1 -0
  46. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsl/parseHsl.js +1 -0
  47. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsl/parseHslLegacy.js +1 -0
  48. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsv/convertHsvToRgb.js +1 -0
  49. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsv/convertRgbToHsv.js +1 -0
  50. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsv/definition.js +1 -0
  51. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/interpolate/lerp.js +1 -0
  52. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/interpolate/linear.js +1 -0
  53. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/interpolate/piecewise.js +1 -0
  54. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/modes.js +1 -0
  55. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/parse.js +4 -0
  56. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rgb/definition.js +1 -0
  57. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rgb/parseHex.js +1 -0
  58. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rgb/parseNamed.js +1 -0
  59. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rgb/parseNumber.js +1 -0
  60. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rgb/parseRgb.js +1 -0
  61. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rgb/parseRgbLegacy.js +1 -0
  62. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rgb/parseTransparent.js +1 -0
  63. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/util/hue.js +1 -0
  64. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/util/normalizeHue.js +1 -0
  65. package/dist/node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/util/regex.js +1 -0
  66. package/dist/select/style/index.js +1 -1
  67. package/dist/slider/Range.d.ts +5 -0
  68. package/dist/slider/Range.js +1 -0
  69. package/dist/slider/Slider.d.ts +6 -0
  70. package/dist/slider/Slider.js +1 -0
  71. package/dist/slider/Thumb.d.ts +5 -0
  72. package/dist/slider/Thumb.js +1 -0
  73. package/dist/slider/Track.d.ts +5 -0
  74. package/dist/slider/Track.js +1 -0
  75. package/dist/slider/__tests__/Slider.test.d.ts +0 -0
  76. package/dist/slider/contexts/index.d.ts +11 -0
  77. package/dist/slider/contexts/index.js +1 -0
  78. package/dist/slider/index.d.ts +10 -0
  79. package/dist/slider/index.js +1 -0
  80. package/dist/slider/interfaces/index.d.ts +26 -0
  81. package/dist/slider/style/index.d.ts +24 -0
  82. package/dist/slider/style/index.js +1 -0
  83. package/dist/tailwind.css +1 -1
  84. package/package.json +3 -2
@@ -0,0 +1,11 @@
1
+ import { ColorAreaController } from './hooks/useColorArea';
2
+ interface AreaProps {
3
+ controller: ColorAreaController;
4
+ disabled?: boolean;
5
+ formattedValue: string;
6
+ }
7
+ declare const Area: {
8
+ ({ controller, disabled, formattedValue }: AreaProps): JSX.Element;
9
+ displayName: string;
10
+ };
11
+ export default Area;
@@ -0,0 +1 @@
1
+ import{jsxs as u,jsx as r}from"react/jsx-runtime";import a from"./style/index.js";const l=({controller:t,disabled:e=!1,formattedValue:o})=>{const{areaRef:s,areaSaturationStyle:n,areaStyle:i,areaThumbStyle:d,areaValueStyle:y,onKeyDown:m,onPointerDown:c}=t;return u("div",{"aria-label":"Saturation and value","aria-valuetext":o,className:a.area({disabled:e}),"data-disabled":e||void 0,onKeyDown:m,onPointerDown:c,ref:s,role:"application",style:i,tabIndex:e?-1:0,children:[r("span",{className:a.areaLayer(),style:n}),r("span",{className:a.areaLayer(),style:y}),r("span",{className:a.areaThumb(),style:d})]})};l.displayName="ColorPicker.Area";export{l as default};
@@ -0,0 +1,6 @@
1
+ import { ColorPickerProps } from './interfaces';
2
+ /**
3
+ * @category Components
4
+ */
5
+ declare const ColorPicker: import('react').ForwardRefExoticComponent<ColorPickerProps & import('react').RefAttributes<HTMLButtonElement>>;
6
+ export default ColorPicker;
@@ -0,0 +1 @@
1
+ import{jsxs as Q,jsx as r}from"react/jsx-runtime";import{useEffectCallback as t}from"@nild/hooks";import{forwardRef as W,useMemo as X,useRef as Y,useState as Z}from"react";import"@nild/shared";import $ from"../_shared/utils/register-slots/index.js";import i from"../popup/index.js";import{DEFAULT_PRESET_COLORS as ee}from"./_shared/color.js";import oe from"./DefaultTrigger.js";import ae from"./hooks/useColorArea.js";import re from"./hooks/useColorPickerState.js";import te from"./Panel.js";import{isTriggerElement as se}from"./Trigger.js";const le=$({trigger:{isMatched:se}}),C=W((g,h)=>{const{className:b,children:u,value:v,defaultValue:E,format:k,defaultFormat:D="hex",onChange:F,onFormatChange:w,presets:x=ee,size:y="medium",disabled:o=!1,placement:I="bottom-start",offset:V=8,portalClassName:N,onKeyDown:f,...R}=g,{slots:T}=X(()=>le(u),[u]),p=Y(null),[P,s]=Z(!1),l=P&&!o,{color:c,commitColor:d,css:n,draftValue:H,format:K,formattedValue:O,hex:S,hue:j,inputInvalid:q,opaqueCss:z,completeInput:L,updateFormat:M,updateHue:_,updateInput:A}=re({defaultFormat:D,defaultValue:E,format:k,onChange:F,onFormatChange:w,value:v}),B=ae({color:c,colorCss:n,disabled:o,onCommitColor:d}),m=t((e=!1)=>{var a;s(!1),e&&((a=p.current)==null||a.focus())}),U=t(()=>{o||s(!0)}),G=t(e=>{e.key==="Escape"&&(e.preventDefault(),m(!0))}),J=t(e=>{if(f?.(e),!(e.defaultPrevented||o))switch(e.key){case"Enter":case" ":e.preventDefault(),s(a=>!a);break;case"Escape":l&&(e.preventDefault(),m(!0));break}});return Q(i,{action:"click",arrowed:!1,disabled:o,offset:V,open:l,placement:I,onClose:()=>m(),onOpen:U,children:[r(i.Trigger,{children:r(oe,{...R,className:b,colorCss:n,customTrigger:T.trigger.el,disabled:o,open:l,ref:h,size:y,triggerRef:p,onKeyDown:J})}),r(i.Portal,{className:N,children:r(te,{area:B,color:c,colorCss:n,disabled:o,draftValue:H,format:K,formattedValue:O,hue:j,inputInvalid:q,opaqueColorCss:z,presets:x,selectedHex:S,onCommitColor:d,onFormatChange:M,onHueChange:_,onInputBlur:L,onInputChange:A,onKeyDown:G})})]})});C.displayName="ColorPicker";export{C as default};
@@ -0,0 +1,14 @@
1
+ import { ButtonHTMLAttributes, ReactElement, RefAttributes, RefObject } from 'react';
2
+ import { ColorPickerSize } from './interfaces';
3
+ interface DefaultTriggerProps extends ButtonHTMLAttributes<HTMLButtonElement> {
4
+ colorCss: string;
5
+ customTrigger?: ReactElement<{
6
+ children?: ReactElement;
7
+ }> | null;
8
+ disabled?: boolean;
9
+ open?: boolean;
10
+ size?: ColorPickerSize;
11
+ triggerRef: RefObject<HTMLElement | null>;
12
+ }
13
+ declare const DefaultTrigger: import('react').ForwardRefExoticComponent<DefaultTriggerProps & RefAttributes<HTMLButtonElement>>;
14
+ export default DefaultTrigger;
@@ -0,0 +1 @@
1
+ import{jsx as m}from"react/jsx-runtime";import{mergeRefs as c,cnMerge as f}from"@nild/shared";import{forwardRef as w,Children as D,isValidElement as N,cloneElement as v}from"react";import C from"../_shared/utils/merge-handlers/index.js";import b from"./style/index.js";import K from"./Swatch.js";const g=w((u,o)=>{const{className:s,colorCss:y,customTrigger:i,disabled:a=!1,open:r=!1,size:x="medium",triggerRef:l,"aria-label":p,onKeyDown:t,...d}=u,h=p??"Select color";if(i){const e=D.toArray(i.props.children).find(N);if(e){const n=e.type==="button";return v(e,{...d,...e.props,"aria-disabled":a||void 0,"aria-expanded":r,"aria-haspopup":"dialog","aria-label":p??e.props["aria-label"],className:f(b.customTrigger({open:r}),s,e.props.className),...n?{disabled:a}:{},"data-disabled":a||void 0,onKeyDown:C(e.props.onKeyDown,t),ref:c(o,e.ref,l),role:n?e.props.role:e.props.role??"button",tabIndex:a?-1:e.props.tabIndex??0})}}return m("button",{...d,"aria-expanded":r,"aria-haspopup":"dialog","aria-label":h,className:f(b.trigger({size:x,disabled:a,open:r}),s),"data-disabled":a||void 0,disabled:a,onKeyDown:t,ref:c(o,l),type:"button",children:m(K,{css:y})})});g.displayName="ColorPicker.DefaultTrigger";export{g as default};
@@ -0,0 +1,31 @@
1
+ import { KeyboardEventHandler } from 'react';
2
+ import { ColorFormat, ColorPickerPreset } from './interfaces';
3
+ import { HsvaColor } from './_shared/color';
4
+ import { ColorAreaController } from './hooks/useColorArea';
5
+ import { CommitColor } from './hooks/useColorPickerState';
6
+ interface PanelProps {
7
+ area: ColorAreaController;
8
+ color: HsvaColor;
9
+ colorCss: string;
10
+ draftValue: string;
11
+ format: ColorFormat;
12
+ formattedValue: string;
13
+ hue: number;
14
+ opaqueColorCss: string;
15
+ presets: ColorPickerPreset[];
16
+ selectedHex: string;
17
+ className?: string;
18
+ disabled?: boolean;
19
+ inputInvalid?: boolean;
20
+ onCommitColor: CommitColor;
21
+ onFormatChange: (format: ColorFormat) => void;
22
+ onHueChange: (hue: number) => void;
23
+ onInputBlur: () => void;
24
+ onInputChange: (value: string | number) => void;
25
+ onKeyDown: KeyboardEventHandler<HTMLDivElement>;
26
+ }
27
+ declare const Panel: {
28
+ ({ area, className, color, colorCss, disabled, draftValue, format, formattedValue, hue, inputInvalid, onCommitColor, onFormatChange, onHueChange, onInputBlur, onInputChange, onKeyDown, opaqueColorCss, presets, selectedHex, }: PanelProps): JSX.Element;
29
+ displayName: string;
30
+ };
31
+ export default Panel;
@@ -0,0 +1 @@
1
+ import{jsx as a,jsxs as o}from"react/jsx-runtime";import{cnMerge as H}from"@nild/shared";import{useMemo as S}from"react";import{getCheckerboardStyle as V}from"./_shared/checkerboard.js";import{getHueCss as j}from"./_shared/color.js";import M from"./Area.js";import P from"./PresetGrid.js";import m from"./SliderControl.js";import e from"./style/index.js";import T from"./Swatch.js";import A from"./ValueControls.js";const B=V("linear-gradient(to right, transparent, var(--nd-color-picker-alpha-color))"),d=({area:c,className:p,color:l,colorCss:t,disabled:r=!1,draftValue:u,format:h,formattedValue:C,hue:s,inputInvalid:f=!1,onCommitColor:n,onFormatChange:b,onHueChange:g,onInputBlur:k,onInputChange:v,onKeyDown:x,opaqueColorCss:i,presets:N,selectedHex:y})=>{const w=S(()=>({"--nd-color-picker-alpha-color":i}),[i]);return a("div",{"aria-label":"Color picker",className:H(p,e.panel()),onKeyDown:x,role:"dialog",tabIndex:-1,children:o("div",{className:e.stack(),children:[a(M,{controller:c,disabled:r,formattedValue:C}),o("div",{className:e.sliderPreviewRow(),children:[o("div",{className:e.sliderStack(),children:[a(m,{disabled:r,label:"Hue",max:360,min:0,step:1,trackClassName:e.hueTrack(),thumbStyle:{backgroundColor:j(s)},value:s,onChange:g}),a(m,{disabled:r,label:"Alpha",max:1,min:0,step:.01,style:w,trackClassName:e.alphaTrack(),trackStyle:B,thumbStyle:{backgroundColor:t},value:l.alpha,onChange:I=>n({...l,alpha:I})})]}),a("span",{className:e.previewSwatch(),children:a(T,{css:t})})]}),a(A,{disabled:r,draftValue:u,format:h,inputInvalid:f,onFormatChange:b,onInputBlur:k,onInputChange:v}),a(P,{disabled:r,presets:N,selectedHex:y,onCommitColor:n})]})})};d.displayName="ColorPicker.Panel";export{d as default};
@@ -0,0 +1,13 @@
1
+ import { ColorPickerPreset } from './interfaces';
2
+ import { CommitColor } from './hooks/useColorPickerState';
3
+ interface PresetGridProps {
4
+ presets: ColorPickerPreset[];
5
+ selectedHex: string;
6
+ disabled?: boolean;
7
+ onCommitColor: CommitColor;
8
+ }
9
+ declare const PresetGrid: {
10
+ ({ disabled, onCommitColor, presets, selectedHex }: PresetGridProps): JSX.Element;
11
+ displayName: string;
12
+ };
13
+ export default PresetGrid;
@@ -0,0 +1 @@
1
+ import{jsx as a,jsxs as u}from"react/jsx-runtime";import{Icon as C}from"@nild/icons";import f from"@nild/icons/CheckSmall";import{useMemo as h}from"react";import{parseColorValue as b,getColorState as x,getReadableTextColor as k}from"./_shared/color.js";import o from"./style/index.js";import v from"./Swatch.js";const c=({disabled:i=!1,onCommitColor:m,presets:t,selectedHex:n})=>{const p=h(()=>t.flatMap(e=>{const r=typeof e=="string"?e:e.value,s=b(r);if(!s)return[];const l=x(s,"hex");return{checkColor:k(s),color:s,css:l.css,hex:l.hex.toLowerCase(),label:typeof e=="string"?e:e.label??r,value:r}}),[t]),d=n.toLowerCase();return a("div",{"aria-label":"Preset colors",className:o.presets(),children:p.map(e=>{const r=e.hex===d;return u("button",{"aria-label":e.label,"aria-pressed":r,className:o.preset(),disabled:i,onClick:()=>m(e.color),type:"button",children:[a(v,{css:e.css}),r&&a("span",{"aria-hidden":"true",className:o.presetCheck(),style:{color:e.checkColor},children:a(C,{className:o.presetCheckIcon(),component:f})})]},e.value)})})};c.displayName="ColorPicker.PresetGrid";export{c as default};
@@ -0,0 +1,19 @@
1
+ import { CSSProperties } from 'react';
2
+ interface SliderControlProps {
3
+ label: string;
4
+ max: number;
5
+ min: number;
6
+ step: number;
7
+ trackClassName: string;
8
+ value: number;
9
+ disabled?: boolean;
10
+ style?: CSSProperties;
11
+ trackStyle?: CSSProperties;
12
+ thumbStyle?: CSSProperties;
13
+ onChange: (value: number) => void;
14
+ }
15
+ declare const SliderControl: {
16
+ ({ disabled, label, max, min, onChange, step, style, trackClassName, trackStyle, thumbStyle, value, }: SliderControlProps): JSX.Element;
17
+ displayName: string;
18
+ };
19
+ export default SliderControl;
@@ -0,0 +1 @@
1
+ import{jsx as a,jsxs as u}from"react/jsx-runtime";import e from"../slider/index.js";import l from"./style/index.js";const s=({disabled:r=!1,label:t,max:o,min:m,onChange:n,step:i,style:c,trackClassName:d,trackStyle:h,thumbStyle:b,value:p})=>a("div",{className:l.controlRow(),style:c,children:u(e,{"aria-label":t,block:!0,className:l.controlSlider(),disabled:r,max:o,min:m,size:"medium",step:i,value:p,variant:"contained",onChange:n,children:[a(e.Track,{className:d,style:h,children:a(e.Range,{className:l.transparentRange()})}),a(e.Thumb,{className:l.controlThumb(),style:b})]})});s.displayName="ColorPicker.SliderControl";export{s as default};
@@ -0,0 +1,8 @@
1
+ interface SwatchProps {
2
+ css: string;
3
+ }
4
+ declare const Swatch: {
5
+ ({ css }: SwatchProps): JSX.Element;
6
+ displayName: string;
7
+ };
8
+ export default Swatch;
@@ -0,0 +1 @@
1
+ import{jsx as a}from"react/jsx-runtime";import{CHECKERBOARD_STYLE as t}from"./_shared/checkerboard.js";import s from"./style/index.js";const r=({css:o})=>a("span",{"aria-hidden":"true",className:s.swatch(),style:t,children:a("span",{className:s.swatchColor(),style:{backgroundColor:o}})});r.displayName="ColorPicker.Swatch";export{r as default};
@@ -0,0 +1,5 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { TriggerProps } from './interfaces';
3
+ export declare const isTriggerElement: (child: ReactNode) => boolean;
4
+ declare const Trigger: FC<TriggerProps>;
5
+ export default Trigger;
@@ -0,0 +1 @@
1
+ import{isValidElement as l}from"react";const i=e=>l(e)&&e.type===r,r=({children:e})=>e??null;r.displayName="ColorPicker.Trigger";export{r as default,i as isTriggerElement};
@@ -0,0 +1,15 @@
1
+ import { ColorFormat } from './interfaces';
2
+ interface ValueControlsProps {
3
+ draftValue: string;
4
+ format: ColorFormat;
5
+ inputInvalid?: boolean;
6
+ disabled?: boolean;
7
+ onFormatChange: (format: ColorFormat) => void;
8
+ onInputBlur: () => void;
9
+ onInputChange: (value: string | number) => void;
10
+ }
11
+ declare const ValueControls: {
12
+ ({ disabled, draftValue, format, inputInvalid, onFormatChange, onInputBlur, onInputChange, }: ValueControlsProps): JSX.Element;
13
+ displayName: string;
14
+ };
15
+ export default ValueControls;
@@ -0,0 +1 @@
1
+ import{jsxs as o,jsx as a}from"react/jsx-runtime";import v from"../input/index.js";import l from"../segment/index.js";import e from"./style/index.js";const n=({disabled:i=!1,draftValue:s,format:t,inputInvalid:r=!1,onFormatChange:m,onInputBlur:d,onInputChange:u})=>o("div",{className:e.inputStack(),children:[o(l,{"aria-label":"Color format",block:!0,className:e.formatSegment(),disabled:i,size:"small",value:t,onChange:m,children:[a(l.Item,{value:"hex",children:"HEX"}),a(l.Item,{value:"rgb",children:"RGB"}),a(l.Item,{value:"hsv",children:"HSV"}),a(l.Item,{value:"hsl",children:"HSL"})]}),a(v,{"aria-invalid":r||void 0,"aria-label":"Color value",className:e.valueInput({invalid:r}),disabled:i,size:"small",value:s,onBlur:d,onChange:u})]});n.displayName="ColorPicker.ValueControls";export{n as default};
@@ -0,0 +1,4 @@
1
+ import { CSSPropertiesWithVars } from '@nild/shared';
2
+ export type CheckerboardStyle = CSSPropertiesWithVars;
3
+ export declare const CHECKERBOARD_STYLE: CheckerboardStyle;
4
+ export declare const getCheckerboardStyle: (overlayImage?: string) => CheckerboardStyle;
@@ -0,0 +1 @@
1
+ const r="conic-gradient(var(--nd-color-picker-checker-color) 25%,transparent 0 50%,var(--nd-color-picker-checker-color) 0 75%,transparent 0)",o="0 0",c="0.5rem 0.5rem",e={"--nd-color-picker-checker-base":"var(--background-color-canvas)","--nd-color-picker-checker-color":"color-mix(in oklch,var(--background-color-muted) 72%,var(--background-color-canvas))",backgroundColor:"var(--nd-color-picker-checker-base)",backgroundImage:r,backgroundPosition:o,backgroundRepeat:"repeat",backgroundSize:c},n=a=>({...e,backgroundImage:`${a},${r}`,backgroundPosition:`0 0,${o}`,backgroundRepeat:"no-repeat,repeat",backgroundSize:`100% 100%,${c}`});export{e as CHECKERBOARD_STYLE,n as getCheckerboardStyle};
@@ -0,0 +1,25 @@
1
+ import { ColorFormat, ColorPickerMeta } from '../interfaces';
2
+ export interface HsvaColor {
3
+ h: number;
4
+ s: number;
5
+ v: number;
6
+ alpha: number;
7
+ }
8
+ export interface ColorState {
9
+ css: string;
10
+ formattedValue: string;
11
+ hex: string;
12
+ meta: ColorPickerMeta;
13
+ opaqueCss: string;
14
+ }
15
+ export declare const normalizeHue: (hue: number | undefined) => number;
16
+ export declare const createHexColor: (r: number, g: number, b: number, alpha?: number) => string;
17
+ export declare const DEFAULT_COLOR: string;
18
+ export declare const DEFAULT_PRESET_COLORS: string[];
19
+ export declare const BLACK_COLOR: string;
20
+ export declare const WHITE_COLOR: string;
21
+ export declare const parseColorValue: (value: string | undefined) => HsvaColor | undefined;
22
+ export declare const normalizeColor: (color: HsvaColor) => HsvaColor;
23
+ export declare const getHueCss: (hue: number) => string;
24
+ export declare const getReadableTextColor: (color: HsvaColor) => string;
25
+ export declare const getColorState: (color: HsvaColor, format: ColorFormat) => ColorState;
@@ -0,0 +1 @@
1
+ import{useMode as M}from"../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/modes.js";import O from"../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/converter.js";import{formatHex8 as z,formatHex as A}from"../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/formatter.js";import F from"../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rgb/definition.js";import B from"../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsl/definition.js";import D from"../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsv/definition.js";const U="#";M(F),M(B),M(D);const E=O("rgb"),W=O("hsv"),q=O("hsl"),I=160,v=(a,r,o)=>Math.min(Math.max(a,r),o),t=(a,r=0)=>v(a??r,0,1),c=a=>a===void 0||Number.isNaN(a)?0:(a%360+360)%360,C=a=>v(Math.round(a),0,255).toString(16).padStart(2,"0"),m=(a,r=2)=>Number(a.toFixed(r)),l=(a,r=2)=>`${m(a,r)}`,K=a=>({r:v(Math.round(a.r*255),0,255),g:v(Math.round(a.g*255),0,255),b:v(Math.round(a.b*255),0,255)}),H=a=>{const r=a?.trim();if(!r)return;const o=r.endsWith("%"),s=Number(o?r.slice(0,-1):r);if(!Number.isNaN(s))return o||Math.abs(s)>1?s/100:s},P=a=>H(a)??1,k=a=>a.includes(",")?a.split(",").map(r=>r.trim()):a.split(/\s+/u).filter(Boolean),y=a=>{const r=/^hsva?\((.*)\)$/iu.exec(a);if(!r)return;const[o,s]=r[1].split("/").map(p=>p.trim()),[e,N,x,g]=k(o),$=Number(e?.replace(/deg$/iu,"")),n=H(N),i=H(x),u=P(s??g);if(!(Number.isNaN($)||n===void 0||i===void 0))return L({alpha:u,h:$,s:n,v:i})},Q=a=>E({mode:"hsv",h:a.h,s:a.s,v:a.v,alpha:a.alpha}),b=(a,r,o,s=1)=>{const e=`${U}${C(a)}${C(r)}${C(o)}`;return s<1?`${e}${C(s*255)}`:e},X=b(22,119,255),j=[[22,119,255],[19,194,194],[82,196,26],[250,173,20],[245,34,45],[114,46,209],[0,0,0],[255,255,255]].map(([a,r,o])=>b(a,r,o)),S=b(0,0,0),T=b(255,255,255),w=a=>{const r=a?.trim();if(!r)return;const o=y(r);if(o)return o;const s=E(r),e=W(r);if(!(!s||!e))return{h:c(e.h),s:t(e.s),v:t(e.v),alpha:t(e.alpha??s.alpha,1)}},L=a=>({h:c(a.h),s:t(a.s),v:t(a.v),alpha:t(a.alpha,1)}),V=a=>{const r=L(a);return{...K(Q(r)),normalizedColor:r}},_=({r:a,g:r,b:o},s=1)=>s<1?`rgba(${a}, ${r}, ${o}, ${l(s)})`:`rgb(${a}, ${r}, ${o})`,G=({r:a,g:r,b:o},s)=>{const e={mode:"rgb",r:a/255,g:r/255,b:o/255,alpha:s};return s<1?z(e):A(e)},J=a=>`hsl(${l(c(a))} 100% 50%)`,Y=a=>{const{r,g:o,b:s}=V({...a,alpha:1});return(r*299+o*587+s*114)/1e3>=I?S:T},Z=(a,r)=>{const{normalizedColor:o,...s}=V(a),{r:e,g:N,b:x}=s,g=o.alpha<1,$=l(o.alpha),n=_(s,o.alpha),i=G(s,o.alpha),u={css:n,hex:i,opaqueCss:_(s)},p={alpha:m(o.alpha),css:n,valid:!0};if(r==="rgb")return{...u,formattedValue:n,meta:{...p,b:x,format:r,g:N,r:e}};if(r==="hsv"){const h=l(o.h),d=l(o.s*100),f=l(o.v*100);return{...u,formattedValue:g?`hsva(${h}, ${d}%, ${f}%, ${$})`:`hsv(${h}, ${d}%, ${f}%)`,meta:{...p,format:r,h:m(o.h),s:m(o.s*100),v:m(o.v*100)}}}if(r==="hsl"){const h=q({mode:"hsv",h:o.h,s:o.s,v:o.v,alpha:o.alpha}),d=l(c(h.h??o.h)),f=l(t(h.s)*100),R=l(t(h.l)*100);return{...u,formattedValue:g?`hsla(${d}, ${f}%, ${R}%, ${$})`:`hsl(${d}, ${f}%, ${R}%)`,meta:{...p,format:r,h:m(o.h),l:m(t(h.l)*100),s:m(t(h.s)*100)}}}return{...u,formattedValue:i,meta:{...p,format:r,hex:i}}};export{S as BLACK_COLOR,X as DEFAULT_COLOR,j as DEFAULT_PRESET_COLORS,T as WHITE_COLOR,b as createHexColor,Z as getColorState,J as getHueCss,Y as getReadableTextColor,L as normalizeColor,c as normalizeHue,w as parseColorValue};
@@ -0,0 +1,20 @@
1
+ import { CSSProperties, KeyboardEvent, PointerEvent as ReactPointerEvent, RefObject } from 'react';
2
+ import { HsvaColor } from '../_shared/color';
3
+ import { CommitColor } from './useColorPickerState';
4
+ interface UseColorAreaOptions {
5
+ color: HsvaColor;
6
+ colorCss: string;
7
+ disabled?: boolean;
8
+ onCommitColor: CommitColor;
9
+ }
10
+ export interface ColorAreaController {
11
+ areaRef: RefObject<HTMLDivElement>;
12
+ areaSaturationStyle: CSSProperties;
13
+ areaStyle: CSSProperties;
14
+ areaThumbStyle: CSSProperties;
15
+ areaValueStyle: CSSProperties;
16
+ onKeyDown: (evt: KeyboardEvent<HTMLDivElement>) => void;
17
+ onPointerDown: (evt: ReactPointerEvent<HTMLDivElement>) => void;
18
+ }
19
+ declare const useColorArea: ({ color, colorCss, disabled, onCommitColor, }: UseColorAreaOptions) => ColorAreaController;
20
+ export default useColorArea;
@@ -0,0 +1 @@
1
+ import{useEffectCallback as l,useEventListener as d}from"@nild/hooks";import{useRef as R,useState as S,useMemo as m}from"react";import{normalizeColor as b,getHueCss as A,BLACK_COLOR as L,WHITE_COLOR as E}from"../_shared/color.js";const T=(r,u,o)=>{const n=u.getBoundingClientRect(),i=n.width<=0?0:(r.clientX-n.left)/n.width,s=n.height<=0?0:(r.clientY-n.top)/n.height;return b({...o,s:i,v:1-s})},I={backgroundImage:`linear-gradient(to top, ${L}, transparent)`},O={backgroundImage:`linear-gradient(to right, ${E}, transparent)`},$=({color:r,colorCss:u,disabled:o=!1,onCommitColor:n})=>{var i;const s=R(null),[c,g]=S(!1),f=l(e=>{const a=s.current;if(!a||o)return r;const t=T(e,a,r);return n(t),t}),h=l(e=>{var a,t;o||e.button!==void 0&&e.button!==0||(e.preventDefault(),e.currentTarget.focus(),(t=(a=e.currentTarget).setPointerCapture)==null||t.call(a,e.pointerId),g(!0),f(e))}),C=l(e=>{c&&(e.preventDefault(),f(e))}),v=l(e=>{c&&(e.preventDefault(),f(e),g(!1))}),k=l(e=>{if(o)return;const a=e.shiftKey?.1:.01;let t;switch(e.key){case"ArrowRight":t={...r,s:r.s+a};break;case"ArrowLeft":t={...r,s:r.s-a};break;case"ArrowUp":t={...r,v:r.v+a};break;case"ArrowDown":t={...r,v:r.v-a};break;case"Home":t={...r,s:0};break;case"End":t={...r,s:1};break}t&&(e.preventDefault(),n(b(t)))}),w=m(()=>({backgroundColor:A(r.h)}),[r.h]),D=m(()=>({backgroundColor:u,left:`${r.s*100}%`,top:`${(1-r.v)*100}%`}),[r.s,r.v,u]),y=((i=s.current)==null?void 0:i.ownerDocument.defaultView)??null,p=c?y:null;return d(p,"pointermove",C),d(p,"pointerup",v),d(p,"pointercancel",v),{areaRef:s,areaSaturationStyle:O,areaStyle:w,areaThumbStyle:D,areaValueStyle:I,onKeyDown:k,onPointerDown:h}};export{$ as default};
@@ -0,0 +1,29 @@
1
+ import { ColorState, HsvaColor } from '../_shared/color';
2
+ import { ColorFormat, ColorPickerProps } from '../interfaces';
3
+ export type CommitColor = (nextColor: HsvaColor, nextFormat?: ColorFormat) => ColorState;
4
+ interface UseColorPickerStateOptions {
5
+ value?: string;
6
+ defaultValue?: string;
7
+ format?: ColorFormat;
8
+ defaultFormat?: ColorFormat;
9
+ onChange?: ColorPickerProps['onChange'];
10
+ onFormatChange?: ColorPickerProps['onFormatChange'];
11
+ }
12
+ interface ColorPickerStateController {
13
+ color: HsvaColor;
14
+ commitColor: CommitColor;
15
+ css: string;
16
+ draftValue: string;
17
+ format: ColorFormat;
18
+ formattedValue: string;
19
+ hex: string;
20
+ hue: number;
21
+ inputInvalid: boolean;
22
+ opaqueCss: string;
23
+ completeInput: () => void;
24
+ updateFormat: (format: ColorFormat) => void;
25
+ updateHue: (hue: number) => void;
26
+ updateInput: (value: string | number) => void;
27
+ }
28
+ declare const useColorPickerState: ({ value: externalValue, defaultValue, format: externalFormat, defaultFormat, onChange, onFormatChange, }: UseColorPickerStateOptions) => ColorPickerStateController;
29
+ export default useColorPickerState;
@@ -0,0 +1 @@
1
+ import{useControllableState as O,useEffectCallback as f,useIsomorphicLayoutEffect as b}from"@nild/hooks";import{useState as h,useMemo as G,useRef as S}from"react";import{parseColorValue as C,getColorState as g,normalizeColor as J,normalizeHue as q,DEFAULT_COLOR as K}from"../_shared/color.js";const N=C(K),z=i=>C(i)??N,P=({value:i,defaultValue:R,format:v,defaultFormat:y="hex",onChange:x,onFormatChange:I})=>{const[l,A]=O(v,y),[n,D]=O(i,R),H=i!==void 0,[t,j]=h(()=>z(n)),{css:M,formattedValue:a,hex:T,opaqueCss:U}=G(()=>g(t,l),[t,l]),[V,E]=h(t.h),[F,d]=h(a),[_,s]=h(!1),c=S(null),p=S(null),m=f((e,r=l)=>{const u=J(e),o=g(u,r),L=!Object.is(n,o.formattedValue);return(!H||!L)&&j(u),L?(p.current=[o.formattedValue,u],D(o.formattedValue),x?.(o.formattedValue,o.meta)):p.current=null,o}),$=f(e=>{Object.is(l,e)||(A(e),I?.(e),c.current=null,m(t,e))}),k=f(e=>{E(e),m({...t,h:e})}),w=f(e=>{const r=`${e}`,u=C(r);if(d(r),!u){s(!0);return}s(!1),c.current=m(u).formattedValue}),B=f(()=>{c.current=null;const e=C(F);if(!e){d(a),s(!1);return}const r=m(e);d(r.formattedValue),s(!1)});return b(()=>{const e=p.current;p.current=null,j(e&&Object.is(n,e[0])?e[1]:z(n))},[n]),b(()=>{q(V)!==q(t.h)&&E(t.h)},[t.h,V]),b(()=>{if(c.current===a){c.current=null;return}d(a),s(!1)},[a]),{color:t,commitColor:m,css:M,draftValue:F,format:l,formattedValue:a,hex:T,hue:V,inputInvalid:_,opaqueCss:U,completeInput:B,updateFormat:$,updateHue:k,updateInput:w}};export{P as default};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @category Components
3
+ */
4
+ declare const ColorPicker: import('react').ForwardRefExoticComponent<import('./interfaces').ColorPickerProps & import('react').RefAttributes<HTMLButtonElement>> & {
5
+ Trigger: import('react').FC<import('./interfaces').TriggerProps>;
6
+ };
7
+ export type * from './interfaces';
8
+ export default ColorPicker;
@@ -0,0 +1 @@
1
+ import r from"./ColorPicker.js";import o from"./Trigger.js";const t=Object.assign(r,{Trigger:o});export{t as default};
@@ -0,0 +1,42 @@
1
+ import { OffsetOptions, Placement } from '@floating-ui/dom';
2
+ import { ButtonHTMLAttributes, HTMLAttributes, ReactElement, ReactNode } from 'react';
3
+ export type ColorFormat = 'hex' | 'rgb' | 'hsv' | 'hsl';
4
+ export type ColorPickerSize = 'small' | 'medium' | 'large';
5
+
6
+ export type ColorPickerMeta<T extends ColorFormat = ColorFormat> = T extends ColorFormat
7
+ ? {
8
+ alpha: number;
9
+ css: string;
10
+ format: T;
11
+ valid: boolean;
12
+ } & (T extends 'hex'
13
+ ? { hex: string }
14
+ : T extends 'rgb'
15
+ ? { r: number; g: number; b: number }
16
+ : T extends 'hsv'
17
+ ? { h: number; s: number; v: number }
18
+ : { h: number; s: number; l: number })
19
+ : never;
20
+
21
+ export type ColorPickerPreset = string | { label?: string; value: string };
22
+
23
+ export interface ColorPickerProps
24
+ extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'defaultValue' | 'onChange' | 'value'> {
25
+ children?: ReactNode;
26
+ value?: string;
27
+ defaultValue?: string;
28
+ format?: ColorFormat;
29
+ defaultFormat?: ColorFormat;
30
+ onChange?: (value: string, meta: ColorPickerMeta) => void;
31
+ onFormatChange?: (format: ColorFormat) => void;
32
+ presets?: ColorPickerPreset[];
33
+ size?: ColorPickerSize;
34
+ disabled?: boolean;
35
+ placement?: Placement;
36
+ offset?: OffsetOptions;
37
+ portalClassName?: string;
38
+ }
39
+
40
+ export interface TriggerProps extends HTMLAttributes<HTMLElement> {
41
+ children?: ReactElement;
42
+ }
@@ -0,0 +1,39 @@
1
+ import { ColorPickerSize } from '../interfaces';
2
+ declare const _default: {
3
+ trigger: (props?: {
4
+ size?: ColorPickerSize;
5
+ disabled?: boolean;
6
+ open?: boolean;
7
+ } | undefined) => string;
8
+ customTrigger: (props?: {
9
+ open?: boolean;
10
+ } | undefined) => string;
11
+ swatch: (props?: object | undefined) => string;
12
+ swatchColor: (props?: object | undefined) => string;
13
+ panel: (props?: object | undefined) => string;
14
+ stack: (props?: object | undefined) => string;
15
+ area: (props?: {
16
+ disabled?: boolean;
17
+ } | undefined) => string;
18
+ areaLayer: (props?: object | undefined) => string;
19
+ areaThumb: (props?: object | undefined) => string;
20
+ sliderPreviewRow: (props?: object | undefined) => string;
21
+ sliderStack: (props?: object | undefined) => string;
22
+ controlRow: (props?: object | undefined) => string;
23
+ controlSlider: (props?: object | undefined) => string;
24
+ controlThumb: (props?: object | undefined) => string;
25
+ previewSwatch: (props?: object | undefined) => string;
26
+ hueTrack: (props?: object | undefined) => string;
27
+ alphaTrack: (props?: object | undefined) => string;
28
+ transparentRange: (props?: object | undefined) => string;
29
+ inputStack: (props?: object | undefined) => string;
30
+ formatSegment: (props?: object | undefined) => string;
31
+ valueInput: (props?: {
32
+ invalid?: boolean;
33
+ } | undefined) => string;
34
+ presets: (props?: object | undefined) => string;
35
+ preset: (props?: object | undefined) => string;
36
+ presetCheck: (props?: object | undefined) => string;
37
+ presetCheckIcon: (props?: object | undefined) => string;
38
+ };
39
+ export default _default;
@@ -0,0 +1 @@
1
+ import{cva as e}from"@nild/shared";import r from"../../_shared/style/index.js";const o=e(["nd-color-picker-trigger","inline-flex","items-center","justify-center","box-border","border","border-main","bg-transparent","p-1","outline-none","transition-[border-color,box-shadow]","enabled:hover:border-brand-hover","enabled:focus-visible:ring-focused",r.disabled],{variants:{size:{small:["size-6","rounded-sm"],medium:["size-8","rounded-md"],large:["size-10","rounded-md"]},disabled:{true:"",false:"cursor-pointer"},open:{true:["border-brand","ring-focused"],false:""}}}),n=e(["nd-color-picker-custom-trigger","outline-none","focus-visible:ring-focused",r.disabled],{variants:{open:{true:["ring-focused"],false:""}}}),i=e(["nd-color-picker-swatch","relative","block","size-full","box-border","overflow-hidden","rounded-sm"]),t=e(["nd-color-picker-swatch-color","absolute","inset-0"]),a=e(["nd-color-picker-panel","w-64","p-3","font-nd","text-main","outline-none"]),l=e(["flex","flex-col","gap-3"]),s=e(["nd-color-picker-area","relative","h-36","w-full","overflow-hidden","rounded-md","border","border-subtle","outline-none","touch-none","select-none","focus-visible:ring-focused",r.disabled],{variants:{disabled:{true:"",false:"cursor-crosshair"}}}),d=e(["absolute","inset-0","pointer-events-none"]),c=e(["nd-color-picker-area-thumb","absolute","size-3","-translate-x-1/2","-translate-y-1/2","rounded-full","border-2","border-canvas","shadow-md","pointer-events-none"]),u=e(["flex","items-stretch","gap-4"]),b=e(["flex","h-9","min-w-0","flex-auto","flex-col","justify-between"]),f=e(["flex","h-3","items-center"]),p=e(["h-3","min-w-0","flex-auto"]),h=e(["group-enabled:group-hover:![box-shadow:var(--tw-shadow,0_0_#00000000)]"]),m=e(["nd-color-picker-preview","block","size-9","shrink-0","overflow-hidden","rounded-md","border","border-main"]),g=e(["h-3","bg-[linear-gradient(to_right,red,yellow,lime,cyan,blue,magenta,red)]"]),v=e(["h-3","border border-main"]),w=e(["bg-transparent"]),k=e(["flex","flex-col","gap-3"]),x=e(["w-full"]),z=e(["w-full"],{variants:{invalid:{true:["border-error","enabled:focus-within:border-error"],false:""}}}),y=e(["grid","grid-cols-8","gap-1.5"]),S=e(["nd-color-picker-preset","relative","size-5","overflow-hidden","rounded-sm","p-0","outline-none","transition-[box-shadow]","focus-visible:ring-focused","enabled:hover:shadow-md"]),T=e(["nd-color-picker-preset-check","absolute","inset-0","z-10","grid","place-items-center","pointer-events-none","leading-none"]),_=e(["inline-flex","items-center","justify-center","text-base","leading-none","[&_svg]:block"]),R={trigger:o,customTrigger:n,swatch:i,swatchColor:t,panel:a,stack:l,area:s,areaLayer:d,areaThumb:c,sliderPreviewRow:u,sliderStack:b,controlRow:f,controlSlider:p,controlThumb:h,previewSwatch:m,hueTrack:g,alphaTrack:v,transparentRange:w,inputStack:k,formatSegment:x,valueInput:z,presets:y,preset:S,presetCheck:T,presetCheckIcon:_};export{R as default};
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { default as Alert } from './alert';
2
2
  import { default as Button } from './button';
3
3
  import { default as Checkbox } from './checkbox';
4
+ import { default as ColorPicker } from './color-picker';
4
5
  import { default as Divider } from './divider';
5
6
  import { default as Field } from './field';
6
7
  import { default as Form } from './form';
@@ -10,10 +11,11 @@ import { default as Popover } from './popover';
10
11
  import { default as Radio } from './radio';
11
12
  import { default as Segment } from './segment';
12
13
  import { default as Select } from './select';
14
+ import { default as Slider } from './slider';
13
15
  import { default as Switch } from './switch';
14
16
  import { default as Tabs } from './tabs';
15
17
  import { default as Tooltip } from './tooltip';
16
18
  import { default as Transition, TransitionStatus } from './transition';
17
19
  import { default as Typography } from './typography';
18
20
  import { default as Watermark } from './watermark';
19
- export { Alert, Button, Checkbox, Divider, Field, Form, Input, Modal, Popover, Radio, Segment, Select, Switch, Tabs, Tooltip, Transition, TransitionStatus, Typography, Watermark, };
21
+ export { Alert, Button, Checkbox, ColorPicker, Divider, Field, Form, Input, Modal, Popover, Radio, Segment, Select, Slider, Switch, Tabs, Tooltip, Transition, TransitionStatus, Typography, Watermark, };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{default as a}from"./alert/index.js";import{default as t}from"./button/index.js";import{default as o}from"./checkbox/index.js";import{default as r}from"./divider/Divider.js";import{default as s}from"./field/index.js";import{default as m}from"./form/index.js";import{default as f}from"./input/index.js";import{default as i}from"./modal/index.js";import{default as e}from"./popover/index.js";import{default as p}from"./radio/index.js";import{default as l}from"./segment/index.js";import{default as d}from"./select/index.js";import{default as u}from"./switch/index.js";import{default as n}from"./tabs/index.js";import{default as T}from"./tooltip/index.js";import{default as S}from"./transition/Transition.js";import{TransitionStatus as c}from"./transition/interfaces/index.js";import{default as b}from"./typography/index.js";import{default as h}from"./watermark/Watermark.js";/* empty css */export{a as Alert,t as Button,o as Checkbox,r as Divider,s as Field,m as Form,f as Input,i as Modal,e as Popover,p as Radio,l as Segment,d as Select,u as Switch,n as Tabs,T as Tooltip,S as Transition,c as TransitionStatus,b as Typography,h as Watermark};
1
+ import{default as a}from"./alert/index.js";import{default as o}from"./button/index.js";import{default as t}from"./checkbox/index.js";import{default as r}from"./color-picker/index.js";import{default as s}from"./divider/Divider.js";import{default as m}from"./field/index.js";import{default as f}from"./form/index.js";import{default as i}from"./input/index.js";import{default as e}from"./modal/index.js";import{default as p}from"./popover/index.js";import{default as l}from"./radio/index.js";import{default as d}from"./segment/index.js";import{default as u}from"./select/index.js";import{default as n}from"./slider/index.js";import{default as S}from"./switch/index.js";import{default as T}from"./tabs/index.js";import{default as c}from"./tooltip/index.js";import{default as k}from"./transition/Transition.js";import{TransitionStatus as g}from"./transition/interfaces/index.js";import{default as h}from"./typography/index.js";import{default as y}from"./watermark/Watermark.js";/* empty css */export{a as Alert,o as Button,t as Checkbox,r as ColorPicker,s as Divider,m as Field,f as Form,i as Input,e as Modal,p as Popover,l as Radio,d as Segment,u as Select,n as Slider,S as Switch,T as Tabs,c as Tooltip,k as Transition,g as TransitionStatus,h as Typography,y as Watermark};
@@ -0,0 +1 @@
1
+ import t from"./parse.js";const i=(o,d)=>o===void 0?void 0:typeof o!="object"?t(o):o.mode!==void 0?o:d?{...o,mode:d}:void 0;export{i as default};
@@ -0,0 +1 @@
1
+ const c=r=>{let s=r.reduce((n,t)=>{if(t!==void 0){let a=t*Math.PI/180;n.sin+=Math.sin(a),n.cos+=Math.cos(a)}return n},{sin:0,cos:0}),e=Math.atan2(s.sin,s.cos)*180/Math.PI;return e<0?360+e:e};export{c as averageAngle};
@@ -0,0 +1 @@
1
+ const e={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};export{e as default};
@@ -0,0 +1 @@
1
+ import{converters as d}from"./modes.js";import m from"./_prepare.js";const b=(r="rgb")=>o=>(o=m(o,r))!==void 0?o.mode===r?o:d[o.mode][r]?d[o.mode][r](o):r==="rgb"?d[o.mode].rgb(o):d.rgb[r](d[o.mode].rgb(o)):void 0;export{b as default};
@@ -0,0 +1 @@
1
+ import h from"./util/normalizeHue.js";const n=(r,t)=>{if(r.h===void 0||t.h===void 0||!r.s||!t.s)return 0;let i=h(r.h),s=h(t.h),a=Math.sin((s-i+360)/2*Math.PI/180);return 2*Math.sqrt(r.s*t.s)*a};export{n as differenceHueSaturation};
@@ -0,0 +1 @@
1
+ const o=t=>{let p=!1,a=t.map(r=>r!==void 0?(p=!0,r):1);return p?a:t};export{o as fixupAlpha};
@@ -0,0 +1 @@
1
+ import u from"../util/normalizeHue.js";const s=(t,r)=>t.map((o,i,p)=>{if(o===void 0)return o;let h=u(o);return i===0||t[i-1]===void 0?h:r(h-u(p[i-1]))}).reduce((o,i)=>!o.length||i===void 0||o[o.length-1]===void 0?(o.push(i),o):(o.push(i+o[o.length-1]),o),[]),a=t=>s(t,r=>Math.abs(r)<=180?r:r-360*Math.sign(r));export{a as fixupHueShorter};
@@ -0,0 +1 @@
1
+ import l from"./converter.js";const x=r=>Math.max(0,Math.min(1,r||0)),t=r=>Math.round(x(r)*255),o=l("rgb"),i=r=>{if(r===void 0)return;let a=t(r.r),n=t(r.g),s=t(r.b);return"#"+(1<<24|a<<16|n<<8|s).toString(16).slice(1)},e=r=>{if(r===void 0)return;let a=t(r.alpha!==void 0?r.alpha:1);return i(r)+(256|a).toString(16).slice(1)},f=r=>i(o(r)),m=r=>e(o(r));export{f as formatHex,m as formatHex8,i as serializeHex,e as serializeHex8};
@@ -0,0 +1 @@
1
+ import g from"../util/normalizeHue.js";function t({h:s,s:c,l:e,alpha:d}){s=g(s!==void 0?s:0),c===void 0&&(c=0),e===void 0&&(e=0);let a=e+c*(e<.5?e:1-e),o=a-(a-e)*2*Math.abs(s/60%2-1),b;switch(Math.floor(s/60)){case 0:b={r:a,g:o,b:2*e-a};break;case 1:b={r:o,g:a,b:2*e-a};break;case 2:b={r:2*e-a,g:a,b:o};break;case 3:b={r:2*e-a,g:o,b:a};break;case 4:b={r:o,g:2*e-a,b:a};break;case 5:b={r:a,g:2*e-a,b:o};break;default:b={r:2*e-a,g:2*e-a,b:2*e-a}}return b.mode="rgb",d!==void 0&&(b.alpha=d),b}export{t as default};
@@ -0,0 +1 @@
1
+ function s({r:o,g:t,b:e,alpha:r}){o===void 0&&(o=0),t===void 0&&(t=0),e===void 0&&(e=0);let a=Math.max(o,t,e),h=Math.min(o,t,e),l={mode:"hsl",s:a===h?0:(a-h)/(1-Math.abs(a+h-1)),l:.5*(a+h)};return a-h!==0&&(l.h=(a===o?(t-e)/(a-h)+(t<e)*6:a===t?(e-o)/(a-h)+2:(o-t)/(a-h)+4)*60),r!==void 0&&(l.alpha=r),l}export{s as default};
@@ -0,0 +1 @@
1
+ import a from"./convertHslToRgb.js";import e from"./convertRgbToHsl.js";import i from"./parseHslLegacy.js";import p from"./parseHsl.js";import{fixupHueShorter as t}from"../fixup/hue.js";import{fixupAlpha as m}from"../fixup/alpha.js";import{interpolatorLinear as o}from"../interpolate/linear.js";import{differenceHueSaturation as f}from"../difference.js";import{averageAngle as s}from"../average.js";const l={mode:"hsl",toMode:{rgb:a},fromMode:{rgb:e},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[p,i],serialize:r=>`hsl(${r.h!==void 0?r.h:"none"} ${r.s!==void 0?r.s*100+"%":"none"} ${r.l!==void 0?r.l*100+"%":"none"}${r.alpha<1?` / ${r.alpha}`:""})`,interpolate:{h:{use:o,fixup:t},s:o,l:o,alpha:{use:o,fixup:m}},difference:{h:f},average:{h:s}};export{l as default};
@@ -0,0 +1 @@
1
+ import{Tok as e}from"../parse.js";function o(f,r){if(!r||r[0]!=="hsl"&&r[0]!=="hsla")return;const t={mode:"hsl"},[,a,n,l,u]=r;if(a.type!==e.None){if(a.type===e.Percentage)return;t.h=a.value}if(n.type!==e.None){if(n.type===e.Hue)return;t.s=n.value/100}if(l.type!==e.None){if(l.type===e.Hue)return;t.l=l.value/100}return u.type!==e.None&&(t.alpha=Math.min(1,Math.max(0,u.type===e.Number?u.value:u.value/100))),t}export{o as default};
@@ -0,0 +1 @@
1
+ import o from"../util/hue.js";import{hue as e,c as h,per as m,num_per as s}from"../util/regex.js";const r=new RegExp(`^hsla?\\(\\s*${e}${h}${m}${h}${m}\\s*(?:,\\s*${s}\\s*)?\\)$`),d=i=>{let a=i.match(r);if(!a)return;let t={mode:"hsl"};return a[3]!==void 0?t.h=+a[3]:a[1]!==void 0&&a[2]!==void 0&&(t.h=o(a[1],a[2])),a[4]!==void 0&&(t.s=Math.min(Math.max(0,a[4]/100),1)),a[5]!==void 0&&(t.l=Math.min(Math.max(0,a[5]/100),1)),a[6]!==void 0?t.alpha=Math.max(0,Math.min(1,a[6]/100)):a[7]!==void 0&&(t.alpha=Math.max(0,Math.min(1,+a[7]))),t};export{d as default};
@@ -0,0 +1 @@
1
+ import g from"../util/normalizeHue.js";function i({h:s,s:b,v:a,alpha:c}){s=g(s!==void 0?s:0),b===void 0&&(b=0),a===void 0&&(a=0);let t=Math.abs(s/60%2-1),o;switch(Math.floor(s/60)){case 0:o={r:a,g:a*(1-b*t),b:a*(1-b)};break;case 1:o={r:a*(1-b*t),g:a,b:a*(1-b)};break;case 2:o={r:a*(1-b),g:a,b:a*(1-b*t)};break;case 3:o={r:a*(1-b),g:a*(1-b*t),b:a};break;case 4:o={r:a*(1-b*t),g:a*(1-b),b:a};break;case 5:o={r:a,g:a*(1-b),b:a*(1-b*t)};break;default:o={r:a*(1-b),g:a*(1-b),b:a*(1-b)}}return o.mode="rgb",c!==void 0&&(o.alpha=c),o}export{i as default};
@@ -0,0 +1 @@
1
+ function l({r:d,g:t,b:o,alpha:v}){d===void 0&&(d=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.max(d,t,o),e=Math.min(d,t,o),h={mode:"hsv",s:a===0?0:1-e/a,v:a};return a-e!==0&&(h.h=(a===d?(t-o)/(a-e)+(t<o)*6:a===t?(o-d)/(a-e)+2:(d-t)/(a-e)+4)*60),v!==void 0&&(h.alpha=v),h}export{l as default};
@@ -0,0 +1 @@
1
+ import e from"./convertHsvToRgb.js";import a from"./convertRgbToHsv.js";import{fixupHueShorter as o}from"../fixup/hue.js";import{fixupAlpha as i}from"../fixup/alpha.js";import{interpolatorLinear as r}from"../interpolate/linear.js";import{differenceHueSaturation as t}from"../difference.js";import{averageAngle as f}from"../average.js";const p={mode:"hsv",toMode:{rgb:e},parse:["--hsv"],serialize:"--hsv",fromMode:{rgb:a},channels:["h","s","v","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:r,fixup:o},s:r,v:r,alpha:{use:r,fixup:i}},difference:{h:t},average:{h:f}};export{p as default};
@@ -0,0 +1 @@
1
+ const s=(r,o,p)=>r+p*(o-r);export{s as lerp};
@@ -0,0 +1 @@
1
+ import{lerp as r}from"./lerp.js";import{interpolatorPiecewise as o}from"./piecewise.js";const e=o(r);export{e as interpolatorLinear};
@@ -0,0 +1 @@
1
+ const d=l=>{let i=[];for(let e=0;e<l.length-1;e++){let t=l[e],o=l[e+1];t===void 0&&o===void 0?i.push(void 0):t!==void 0&&o!==void 0?i.push([t,o]):i.push(t!==void 0?[t,t]:[o,o])}return i},h=l=>i=>{let e=d(i);return t=>{let o=t*e.length,n=t>=1?e.length-1:Math.max(Math.floor(o),0),r=e[n];return r===void 0?void 0:l(r[0],r[1],o-n)}};export{h as interpolatorPiecewise};
@@ -0,0 +1 @@
1
+ import f from"./converter.js";const s={},n={},t=[],a={},p=e=>e,r=e=>(s[e.mode]={...s[e.mode],...e.toMode},Object.keys(e.fromMode||{}).forEach(o=>{s[o]||(s[o]={}),s[o][e.mode]=e.fromMode[o]}),e.ranges||(e.ranges={}),e.difference||(e.difference={}),e.channels.forEach(o=>{if(e.ranges[o]===void 0&&(e.ranges[o]=[0,1]),!e.interpolate[o])throw new Error(`Missing interpolator for: ${o}`);typeof e.interpolate[o]=="function"&&(e.interpolate[o]={use:e.interpolate[o]}),e.interpolate[o].fixup||(e.interpolate[o].fixup=p)}),n[e.mode]=e,(e.parse||[]).forEach(o=>{i(o,e.mode)}),f(e.mode)),d=e=>n[e],i=(e,o)=>{if(typeof e=="string"){if(!o)throw new Error("'mode' required when 'parser' is a string");a[e]=o}else typeof e=="function"&&t.indexOf(e)<0&&t.push(e)};export{a as colorProfiles,s as converters,d as getMode,t as parsers,r as useMode,i as useParser};
@@ -0,0 +1,4 @@
1
+ import{parsers as g,colorProfiles as P,getMode as A}from"./modes.js";const y=/[^\x00-\x7F]|[a-zA-Z_]/,b=/[^\x00-\x7F]|[-\w]/,i={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"};let u=0;function c(t){let e=t[u],r=t[u+1];return e==="-"||e==="+"?/\d/.test(r)||r==="."&&/\d/.test(t[u+2]):e==="."?/\d/.test(r):/\d/.test(e)}function v(t){if(u>=t.length)return!1;let e=t[u];if(y.test(e))return!0;if(e==="-"){if(t.length-u<2)return!1;let r=t[u+1];return!!(r==="-"||y.test(r))}return!1}const F={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function f(t){let e="";if((t[u]==="-"||t[u]==="+")&&(e+=t[u++]),e+=h(t),t[u]==="."&&/\d/.test(t[u+1])&&(e+=t[u++]+h(t)),(t[u]==="e"||t[u]==="E")&&((t[u+1]==="-"||t[u+1]==="+")&&/\d/.test(t[u+2])?e+=t[u++]+t[u++]+h(t):/\d/.test(t[u+1])&&(e+=t[u++]+h(t))),v(t)){let r=d(t);return r==="deg"||r==="rad"||r==="turn"||r==="grad"?{type:i.Hue,value:e*F[r]}:void 0}return t[u]==="%"?(u++,{type:i.Percentage,value:+e}):{type:i.Number,value:+e}}function h(t){let e="";for(;/\d/.test(t[u]);)e+=t[u++];return e}function d(t){let e="";for(;u<t.length&&b.test(t[u]);)e+=t[u++];return e}function I(t){let e=d(t);return t[u]==="("?(u++,{type:i.Function,value:e}):e==="none"?{type:i.None,value:void 0}:{type:i.Ident,value:e}}function m(t=""){let e=t.trim(),r=[],n;for(u=0;u<e.length;){if(n=e[u++],n===`
2
+ `||n===" "||n===" "){for(;u<e.length&&(e[u]===`
3
+ `||e[u]===" "||e[u]===" ");)u++;continue}if(n===",")return;if(n===")"){r.push({type:i.ParenClose});continue}if(n==="+"){if(u--,c(e)){r.push(f(e));continue}return}if(n==="-"){if(u--,c(e)){r.push(f(e));continue}if(v(e)){r.push({type:i.Ident,value:d(e)});continue}return}if(n==="."){if(u--,c(e)){r.push(f(e));continue}return}if(n==="/"){for(;u<e.length&&(e[u]===`
4
+ `||e[u]===" "||e[u]===" ");)u++;let o;if(c(e)&&(o=f(e),o.type!==i.Hue)){r.push({type:i.Alpha,value:o});continue}if(v(e)&&d(e)==="none"){r.push({type:i.Alpha,value:{type:i.None,value:void 0}});continue}return}if(/\d/.test(n)){u--,r.push(f(e));continue}if(y.test(n)){u--,r.push(I(e));continue}return}return r}function N(t){t._i=0;let e=t[t._i++];if(!e||e.type!==i.Function||e.value!=="color"||(e=t[t._i++],e.type!==i.Ident))return;const r=P[e.value];if(!r)return;const n={mode:r},o=_(t,!1);if(!o)return;const p=A(r).channels;for(let s=0,l,a;s<p.length;s++)l=o[s],a=p[s],l.type!==i.None&&(n[a]=l.type===i.Number?l.value:l.value/100,a==="alpha"&&(n[a]=Math.max(0,Math.min(1,n[a]))));return n}function _(t,e){const r=[];let n;for(;t._i<t.length;){if(n=t[t._i++],n.type===i.None||n.type===i.Number||n.type===i.Alpha||n.type===i.Percentage||e&&n.type===i.Hue){r.push(n);continue}if(n.type===i.ParenClose){if(t._i<t.length)return;continue}return}if(!(r.length<3||r.length>4)){if(r.length===4){if(r[3].type!==i.Alpha)return;r[3]=r[3].value}return r.length===3&&r.push({type:i.None,value:void 0}),r.every(o=>o.type!==i.Alpha)?r:void 0}}function x(t,e){t._i=0;let r=t[t._i++];if(!r||r.type!==i.Function)return;let n=_(t,e);if(n)return n.unshift(r.value),n}const C=t=>{if(typeof t!="string")return;const e=m(t),r=e?x(e,!0):void 0;let n,o=0,p=g.length;for(;o<p;)if((n=g[o++](t,r))!==void 0)return n;return e?N(e):void 0};export{i as Tok,C as default,N as parseColorSyntax,x as parseModernSyntax,m as tokenize};
@@ -0,0 +1 @@
1
+ import o from"./parseNamed.js";import a from"./parseHex.js";import p from"./parseRgbLegacy.js";import t from"./parseRgb.js";import i from"./parseTransparent.js";import{interpolatorLinear as r}from"../interpolate/linear.js";import{fixupAlpha as m}from"../fixup/alpha.js";const e={mode:"rgb",channels:["r","g","b","alpha"],parse:[t,a,p,o,i,"srgb"],serialize:"srgb",interpolate:{r,g:r,b:r,alpha:{use:r,fixup:m}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}};export{e as default};
@@ -0,0 +1 @@
1
+ import e from"./parseNumber.js";const r=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,f=a=>{let t;return(t=a.match(r))?e(parseInt(t[1],16),t[1].length):void 0};export{f as default};
@@ -0,0 +1 @@
1
+ import t from"./parseNumber.js";import r from"../colors/named.js";const e=o=>t(r[o.toLowerCase()],6);export{e as default};
@@ -0,0 +1 @@
1
+ const b=(r,e)=>{if(typeof r=="number"){if(e===3)return{mode:"rgb",r:(r>>8&15|r>>4&240)/255,g:(r>>4&15|r&240)/255,b:(r&15|r<<4&240)/255};if(e===4)return{mode:"rgb",r:(r>>12&15|r>>8&240)/255,g:(r>>8&15|r>>4&240)/255,b:(r>>4&15|r&240)/255,alpha:(r&15|r<<4&240)/255};if(e===6)return{mode:"rgb",r:(r>>16&255)/255,g:(r>>8&255)/255,b:(r&255)/255};if(e===8)return{mode:"rgb",r:(r>>24&255)/255,g:(r>>16&255)/255,b:(r>>8&255)/255,alpha:(r&255)/255}}};export{b as default};
@@ -0,0 +1 @@
1
+ import{Tok as e}from"../parse.js";function y(l,p){if(!p||p[0]!=="rgb"&&p[0]!=="rgba")return;const t={mode:"rgb"},[,u,a,r,o]=p;if(!(u.type===e.Hue||a.type===e.Hue||r.type===e.Hue))return u.type!==e.None&&(t.r=u.type===e.Number?u.value/255:u.value/100),a.type!==e.None&&(t.g=a.type===e.Number?a.value/255:a.value/100),r.type!==e.None&&(t.b=r.type===e.Number?r.value/255:r.value/100),o.type!==e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===e.Number?o.value:o.value/100))),t}export{y as default};
@@ -0,0 +1 @@
1
+ import{num as r,c as s,num_per as t,per as $}from"../util/regex.js";const o=new RegExp(`^rgba?\\(\\s*${r}${s}${r}${s}${r}\\s*(?:,\\s*${t}\\s*)?\\)$`),d=new RegExp(`^rgba?\\(\\s*${$}${s}${$}${s}${$}\\s*(?:,\\s*${t}\\s*)?\\)$`),m=i=>{let e={mode:"rgb"},a;if(a=i.match(o))a[1]!==void 0&&(e.r=a[1]/255),a[2]!==void 0&&(e.g=a[2]/255),a[3]!==void 0&&(e.b=a[3]/255);else if(a=i.match(d))a[1]!==void 0&&(e.r=a[1]/100),a[2]!==void 0&&(e.g=a[2]/100),a[3]!==void 0&&(e.b=a[3]/100);else return;return a[4]!==void 0?e.alpha=Math.max(0,Math.min(1,a[4]/100)):a[5]!==void 0&&(e.alpha=Math.max(0,Math.min(1,+a[5]))),e};export{m as default};
@@ -0,0 +1 @@
1
+ const e=a=>a==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0;export{e as default};
@@ -0,0 +1 @@
1
+ const a=(r,t)=>{switch(t){case"deg":return+r;case"rad":return r/Math.PI*180;case"grad":return r/10*9;case"turn":return r*360}};export{a as default};
@@ -0,0 +1 @@
1
+ const t=o=>(o=o%360)<0?o+360:o;export{t as default};
@@ -0,0 +1 @@
1
+ const s="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",a=`${s}%`,d=`(?:${s}%|${s})`,e=`(?:${s}(deg|grad|rad|turn)|${s})`,r="\\s*,\\s*";export{r as c,e as hue,s as num,d as num_per,a as per};
@@ -1 +1 @@
1
- import{cva as e}from"@nild/shared";import t from"../../_shared/style/index.js";const l=e(["nd-select-trigger","group",["inline-flex","items-center"],"box-border","font-nd","overflow-hidden","text-left","appearance-none","border","transition-colors","outline-none",t.disabled],{variants:{variant:{outlined:["bg-transparent","border-main","enabled:hover:border-brand-hover"],filled:["bg-muted","border-subtle"],underlined:["bg-transparent","border-transparent","border-b-main","enabled:hover:border-b-brand-hover","enabled:focus-visible:border-b-brand"]},size:{small:["h-6","text-sm"],medium:["h-8","text-md"],large:["h-10","text-lg"]},block:{true:["flex","w-full"],false:""},disabled:{true:"",false:"cursor-pointer"},open:{true:["z-1"],false:""}},compoundVariants:[{variant:["outlined","filled"],size:"small",className:["rounded-sm"]},{variant:["outlined","filled"],size:["medium","large"],className:["rounded-md"]},{variant:["outlined","filled"],open:!0,className:["border-brand","ring-focused"]},{variant:"underlined",open:!0,className:["border-b-brand"]},{variant:"filled",disabled:!1,open:!1,className:["enabled:hover:bg-muted-hover","enabled:hover:border-muted"]},{variant:"filled",open:!0,className:["bg-muted-hover"]}]}),n=e(["nd-select-trigger-content","min-w-0","flex-auto","truncate"],{variants:{size:{small:["text-sm"],medium:["text-md"],large:["text-lg"]},placeholder:{true:["text-subtle"],false:["text-main"]}},compoundVariants:[{variant:["outlined","filled"],size:"small",className:["pl-2"]},{variant:["outlined","filled"],size:"medium",className:["pl-3"]},{variant:["outlined","filled"],size:"large",className:["pl-4"]}]}),a=e(["nd-select-trigger-icon","shrink-0","inline-flex","items-center","text-muted","transition-transform"],{variants:{size:{small:["text-sm"],medium:["text-md"],large:["text-lg"]},open:{true:["rotate-180"],false:""}},compoundVariants:[{variant:["outlined","filled"],size:"small",className:["px-2"]},{variant:["outlined","filled"],size:"medium",className:["px-3"]},{variant:["outlined","filled"],size:"large",className:["px-4"]}]}),r=e(["nd-select-listbox","max-h-60","overflow-auto","overscroll-contain","px-1","py-1","outline-none"]),i=e(["nd-select-option","w-full","flex","items-center","gap-2","rounded-sm","text-left","text-main","select-none","transition-colors",t.disabled],{variants:{size:{small:["min-h-8","px-2","text-sm"],medium:["min-h-9","px-3","text-md"],large:["min-h-10","px-4","text-lg"]},disabled:{true:["text-subtle"],false:["cursor-pointer"]},active:{true:["bg-surface-muted"],false:""}}}),s=e(["nd-select-option-content","min-w-0","flex-auto"]),o=e(["nd-select-option-label","block","truncate"]),d=e(["nd-select-option-indicator","shrink-0","inline-flex","items-center","justify-center"],{variants:{size:{small:["size-3.5","text-sm"],medium:["size-4","text-md"],large:["size-4.5","text-lg"]}}}),m={trigger:l,triggerContent:n,triggerIcon:a,listbox:r,option:i,optionContent:s,optionLabel:o,optionIndicator:d};export{m as default};
1
+ import{cva as e}from"@nild/shared";import t from"../../_shared/style/index.js";const l=e(["nd-select-trigger","group",["inline-flex","items-center"],"box-border","font-nd","overflow-hidden","text-left","appearance-none","border","transition-colors","outline-none",t.disabled],{variants:{variant:{outlined:["bg-transparent","border-main","enabled:hover:border-brand-hover"],filled:["bg-muted","border-subtle"],underlined:["bg-transparent","border-transparent","border-b-main","enabled:hover:border-b-brand-hover","enabled:focus-visible:border-b-brand"]},size:{small:["h-6","text-sm"],medium:["h-8","text-md"],large:["h-10","text-lg"]},block:{true:["flex","w-full"],false:""},disabled:{true:"",false:"cursor-pointer"},open:{true:["z-1"],false:""}},compoundVariants:[{variant:["outlined","filled"],size:"small",className:["rounded-sm"]},{variant:["outlined","filled"],size:["medium","large"],className:["rounded-md"]},{variant:["outlined","filled"],open:!0,className:["border-brand","ring-focused"]},{variant:"underlined",open:!0,className:["border-b-brand"]},{variant:"filled",disabled:!1,open:!1,className:["enabled:hover:bg-muted-hover","enabled:hover:border-muted"]},{variant:"filled",open:!0,className:["bg-muted-hover"]}]}),n=e(["nd-select-trigger-content","min-w-0","flex-auto","truncate"],{variants:{size:{small:["text-sm"],medium:["text-md"],large:["text-lg"]},placeholder:{true:["text-subtle"],false:["text-main"]}},compoundVariants:[{variant:["outlined","filled"],size:"small",className:["pl-2"]},{variant:["outlined","filled"],size:"medium",className:["pl-3"]},{variant:["outlined","filled"],size:"large",className:["pl-4"]}]}),a=e(["nd-select-trigger-icon","shrink-0","inline-flex","items-center","text-muted","transition-transform"],{variants:{size:{small:["text-sm"],medium:["text-md"],large:["text-lg"]},open:{true:["rotate-180"],false:""}},compoundVariants:[{variant:["outlined","filled"],size:"small",className:["px-2"]},{variant:["outlined","filled"],size:"medium",className:["px-3"]},{variant:["outlined","filled"],size:"large",className:["px-4"]}]}),i=e(["nd-select-listbox","max-h-60","overflow-auto","overscroll-contain","px-1","py-1","outline-none"]),r=e(["nd-select-option","w-full","flex","items-center","gap-2","rounded-sm","text-left","text-main","select-none","transition-colors",t.disabled],{variants:{size:{small:["min-h-8","px-2","text-sm"],medium:["min-h-9","px-3","text-md"],large:["min-h-10","px-4","text-lg"]},disabled:{true:["text-subtle"],false:["cursor-pointer"]},active:{true:["bg-muted"],false:""}}}),o=e(["nd-select-option-content","min-w-0","flex-auto"]),s=e(["nd-select-option-label","block","truncate"]),d=e(["nd-select-option-indicator","shrink-0","inline-flex","items-center","justify-center"],{variants:{size:{small:["size-3.5","text-sm"],medium:["size-4","text-md"],large:["size-4.5","text-lg"]}}}),m={trigger:l,triggerContent:n,triggerIcon:a,listbox:i,option:r,optionContent:o,optionLabel:s,optionIndicator:d};export{m as default};
@@ -0,0 +1,5 @@
1
+ import { ReactElement, ReactNode } from 'react';
2
+ import { RangeProps } from './interfaces';
3
+ declare const Range: import('react').ForwardRefExoticComponent<RangeProps & import('react').RefAttributes<HTMLSpanElement>>;
4
+ export declare const isRangeElement: (child: ReactNode) => child is ReactElement<RangeProps>;
5
+ export default Range;
@@ -0,0 +1 @@
1
+ import{jsx as m}from"react/jsx-runtime";import{cnMerge as l}from"@nild/shared";import{forwardRef as f,isValidElement as p}from"react";import{useSliderContext as d}from"./contexts/index.js";import c from"./style/index.js";const e=f(({className:a,style:t,...s},o)=>{const{orientation:n,rangeStyle:r,variant:i}=d();return m("span",{...s,className:l(c.range({orientation:n,variant:i}),a),ref:o,style:t?{...r,...t}:r})});e.displayName="Slider.Range";const g=a=>p(a)&&a.type===e;export{e as default,g as isRangeElement};
@@ -0,0 +1,6 @@
1
+ import { SliderProps } from './interfaces';
2
+ /**
3
+ * @category Components
4
+ */
5
+ declare const Slider: import('react').ForwardRefExoticComponent<SliderProps & import('react').RefAttributes<HTMLDivElement>>;
6
+ export default Slider;
@@ -0,0 +1 @@
1
+ import{jsx as C,jsxs as re}from"react/jsx-runtime";import{useControllableState as ne,useEffectCallback as d,useEventListener as S}from"@nild/hooks";import{mergeRefs as oe,cnMerge as ie}from"@nild/shared";import{forwardRef as le,useMemo as g,useRef as se,useState as ue}from"react";import ce from"../_shared/utils/register-slots/index.js";import{SliderProvider as me}from"./contexts/index.js";import de from"./style/index.js";import fe,{isThumbElement as ve}from"./Thumb.js";import be,{isTrackElement as he}from"./Track.js";const pe=0,we=100,H=1,O=10,ge=ce({track:{isMatched:he},thumb:{isMatched:ve}}),X=(r,a,n)=>Math.min(Math.max(r,a),n),Y=r=>{var a;return((a=`${r}`.split(".")[1])==null?void 0:a.length)??0},q=(r,a,n,o,f)=>{const s=a+Math.round((r-a)/o)*o;return X(Number(s.toFixed(f)),a,n)},ke=(r,a,n)=>{const o=n-a;return o<=0?0:(r-a)/o*100},xe=(r,a,n,o,f)=>{const s=a.getBoundingClientRect(),h=n==="vertical"?s.height:s.width;if(h<=0)return o;const p=n==="vertical"?s.bottom-r.clientY:r.clientX-s.left,w=X(p/h,0,1);return o+(f-o)*w},G=le((r,a)=>{var n;const{className:o,children:f,value:s,defaultValue:h,min:p=pe,max:w=we,step:E=H,orientation:i="horizontal",size:k="medium",variant:x="floating",block:J=!1,disabled:c=!1,onChange:R,onComplete:$,onKeyDown:z,onPointerDown:A,...N}=r,{slots:T}=g(()=>ge(f),[f]),u=Math.min(p,w),v=Math.max(p,w),m=E>0?E:H,j=Math.max(Y(m),Y(u)),D=se(null),[M,I]=ue(!1),[Q,W]=ne(s,h??u),l=q(Q,u,v,m,j),b=ke(l,u,v),K=d(e=>{const t=q(e,u,v,m,j);return Object.is(t,l)||(W(t),R?.(t)),t}),P=d(e=>{const t=D.current;return!t||c?l:K(xe(e,t,i,u,v))}),L=d((e=l)=>{I(!1),$?.(e)}),Z=d(e=>{var t,F;A?.(e),!(e.defaultPrevented||c||e.button!==void 0&&e.button!==0)&&(e.preventDefault(),e.currentTarget.focus(),(F=(t=e.currentTarget).setPointerCapture)==null||F.call(t,e.pointerId),I(!0),P(e))}),_=d(e=>{M&&(e.preventDefault(),P(e))}),U=d(e=>{M&&(e.preventDefault(),L(P(e)))}),ee=d(e=>{if(z?.(e),e.defaultPrevented||c)return;let t;switch(e.key){case"ArrowRight":case"ArrowUp":t=l+m;break;case"ArrowLeft":case"ArrowDown":t=l-m;break;case"PageUp":t=l+m*O;break;case"PageDown":t=l-m*O;break;case"Home":t=u;break;case"End":t=v;break}t!==void 0&&(e.preventDefault(),L(K(t)))}),te=((n=D.current)==null?void 0:n.ownerDocument.defaultView)??null,y=M?te:null;S(y,"pointermove",_),S(y,"pointerup",U),S(y,"pointercancel",U);const V=g(()=>i==="vertical"?{height:`${b}%`}:{width:`${b}%`},[i,b]),B=g(()=>i==="vertical"?{bottom:`${b}%`}:{left:`${b}%`},[i,b]),ae=g(()=>({orientation:i,rangeStyle:V,size:k,thumbStyle:B,variant:x}),[i,V,k,B,x]);return C(me,{value:ae,children:re("div",{...N,"aria-disabled":c,"aria-orientation":i,"aria-valuemax":v,"aria-valuemin":u,"aria-valuenow":l,className:ie(de.slider({orientation:i,size:k,variant:x,block:J,disabled:c}),o),"data-disabled":c||void 0,onKeyDown:ee,onPointerDown:Z,ref:oe(a,D),role:"slider",tabIndex:c?-1:N.tabIndex??0,children:[T.track.el??C(be,{}),T.thumb.el??C(fe,{})]})})});G.displayName="Slider";export{G as default};
@@ -0,0 +1,5 @@
1
+ import { ReactElement, ReactNode } from 'react';
2
+ import { ThumbProps } from './interfaces';
3
+ declare const Thumb: import('react').ForwardRefExoticComponent<ThumbProps & import('react').RefAttributes<HTMLSpanElement>>;
4
+ export declare const isThumbElement: (child: ReactNode) => child is ReactElement<ThumbProps>;
5
+ export default Thumb;
@@ -0,0 +1 @@
1
+ import{jsx as d}from"react/jsx-runtime";import{cnMerge as f}from"@nild/shared";import{forwardRef as p,isValidElement as u}from"react";import{useSliderContext as c}from"./contexts/index.js";import h from"./style/index.js";const t=p(({className:e,children:s,style:r,...i},m)=>{const{orientation:o,size:n,thumbStyle:a,variant:l}=c();return d("span",{...i,"aria-hidden":"true",className:f(h.thumb({orientation:o,size:n,variant:l}),e),ref:m,style:r?{...a,...r}:a,children:s})});t.displayName="Slider.Thumb";const b=e=>u(e)&&e.type===t;export{t as default,b as isThumbElement};
@@ -0,0 +1,5 @@
1
+ import { ReactElement, ReactNode } from 'react';
2
+ import { TrackProps } from './interfaces';
3
+ declare const Track: import('react').ForwardRefExoticComponent<TrackProps & import('react').RefAttributes<HTMLSpanElement>>;
4
+ export declare const isTrackElement: (child: ReactNode) => child is ReactElement<TrackProps>;
5
+ export default Track;
@@ -0,0 +1 @@
1
+ import{jsxs as l,jsx as c}from"react/jsx-runtime";import{cnMerge as d}from"@nild/shared";import{forwardRef as f,isValidElement as p}from"react";import h from"../_shared/utils/register-slots/index.js";import{useSliderContext as g}from"./contexts/index.js";import u,{isRangeElement as x}from"./Range.js";import k from"./style/index.js";const E=h({range:{isMatched:x}}),e=f(({className:r,children:a,...s},t)=>{const{orientation:i,variant:o}=g(),{slots:n,restChildren:m}=E(a);return l("span",{...s,"aria-hidden":"true",className:d(k.track({orientation:i,variant:o}),r),ref:t,children:[n.range.el??c(u,{}),m]})});e.displayName="Slider.Track";const M=r=>p(r)&&r.type===e;export{e as default,M as isTrackElement};
File without changes
@@ -0,0 +1,11 @@
1
+ import { CSSProperties } from 'react';
2
+ import { SliderOrientation, SliderSize, SliderVariant } from '../interfaces';
3
+ export interface SliderContextValue {
4
+ orientation: SliderOrientation;
5
+ size: SliderSize;
6
+ variant: SliderVariant;
7
+ rangeStyle: CSSProperties;
8
+ thumbStyle: CSSProperties;
9
+ }
10
+ declare const SliderProvider: import('react').Provider<SliderContextValue>, useSliderContext: () => SliderContextValue;
11
+ export { SliderProvider, useSliderContext };
@@ -0,0 +1 @@
1
+ import{createContextSuite as t}from"@nild/shared";const[e,i]=t({defaultValue:{orientation:"horizontal",size:"medium",variant:"floating",rangeStyle:{width:"0%"},thumbStyle:{left:"0%"}}});export{e as SliderProvider,i as useSliderContext};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @category Components
3
+ */
4
+ declare const Slider: import('react').ForwardRefExoticComponent<import('./interfaces').SliderProps & import('react').RefAttributes<HTMLDivElement>> & {
5
+ Track: import('react').ForwardRefExoticComponent<import('./interfaces').TrackProps & import('react').RefAttributes<HTMLSpanElement>>;
6
+ Range: import('react').ForwardRefExoticComponent<import('./interfaces').RangeProps & import('react').RefAttributes<HTMLSpanElement>>;
7
+ Thumb: import('react').ForwardRefExoticComponent<import('./interfaces').ThumbProps & import('react').RefAttributes<HTMLSpanElement>>;
8
+ };
9
+ export type * from './interfaces';
10
+ export default Slider;
@@ -0,0 +1 @@
1
+ import o from"./Range.js";import r from"./Slider.js";import m from"./Thumb.js";import t from"./Track.js";const p=Object.assign(r,{Track:t,Range:o,Thumb:m});export{p as default};
@@ -0,0 +1,26 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export type SliderOrientation = 'horizontal' | 'vertical';
3
+ export type SliderSize = 'small' | 'medium' | 'large';
4
+ export type SliderVariant = 'floating' | 'contained';
5
+
6
+ export interface SliderProps extends Omit<HTMLAttributes<HTMLDivElement>, 'defaultValue' | 'onChange'> {
7
+ children?: ReactNode;
8
+ value?: number;
9
+ defaultValue?: number;
10
+ min?: number;
11
+ max?: number;
12
+ step?: number;
13
+ orientation?: SliderOrientation;
14
+ size?: SliderSize;
15
+ variant?: SliderVariant;
16
+ block?: boolean;
17
+ disabled?: boolean;
18
+ onChange?: (value: number) => void;
19
+ onComplete?: (value: number) => void;
20
+ }
21
+
22
+ export type TrackProps = HTMLAttributes<HTMLSpanElement>;
23
+
24
+ export type RangeProps = HTMLAttributes<HTMLSpanElement>;
25
+
26
+ export type ThumbProps = HTMLAttributes<HTMLSpanElement>;
@@ -0,0 +1,24 @@
1
+ import { SliderOrientation, SliderSize, SliderVariant } from '../interfaces';
2
+ declare const _default: {
3
+ slider: (props?: {
4
+ orientation?: SliderOrientation;
5
+ size?: SliderSize;
6
+ variant?: SliderVariant;
7
+ block?: boolean;
8
+ disabled?: boolean;
9
+ } | undefined) => string;
10
+ track: (props?: {
11
+ orientation?: SliderOrientation;
12
+ variant?: SliderVariant;
13
+ } | undefined) => string;
14
+ range: (props?: {
15
+ orientation?: SliderOrientation;
16
+ variant?: SliderVariant;
17
+ } | undefined) => string;
18
+ thumb: (props?: {
19
+ orientation?: SliderOrientation;
20
+ size?: SliderSize;
21
+ variant?: SliderVariant;
22
+ } | undefined) => string;
23
+ };
24
+ export default _default;
@@ -0,0 +1 @@
1
+ import{cva as a}from"@nild/shared";import n from"../../_shared/style/index.js";const e=["group-enabled:group-hover:ring-focused","group-enabled:group-focus-visible:ring-focused"],t=a(["nd-slider","group","relative","inline-flex","box-border","font-nd","touch-none","select-none","outline-none",n.disabled],{variants:{orientation:{horizontal:["w-48","items-center"],vertical:["h-40","justify-center"]},size:{small:["[--nd-slider-size:1rem]","[--nd-slider-track-size:0.125rem]","[--nd-slider-thumb-size:0.75rem]"],medium:["[--nd-slider-size:1.25rem]","[--nd-slider-track-size:0.25rem]","[--nd-slider-thumb-size:0.875rem]"],large:["[--nd-slider-size:1.5rem]","[--nd-slider-track-size:0.375rem]","[--nd-slider-thumb-size:1rem]"]},variant:{floating:"",contained:""},block:{true:"",false:""},disabled:{true:"",false:"cursor-pointer"}},defaultVariants:{orientation:"horizontal",size:"medium",variant:"floating"},compoundVariants:[{orientation:"horizontal",className:"h-[var(--nd-slider-size)]"},{orientation:"vertical",className:"w-[var(--nd-slider-size)]"},{size:"small",variant:"contained",className:"[--nd-slider-size:0.625rem]"},{size:"medium",variant:"contained",className:"[--nd-slider-size:0.75rem]"},{size:"large",variant:"contained",className:"[--nd-slider-size:0.875rem]"},{orientation:"horizontal",block:!0,className:"w-full"},{orientation:"vertical",block:!0,className:"h-full"}]}),i=a(["nd-slider-track","absolute","rounded-full","bg-muted"],{variants:{orientation:{horizontal:["left-0","right-0","h-[var(--nd-slider-track-size)]"],vertical:["top-0","bottom-0","w-[var(--nd-slider-track-size)]"]},variant:{floating:"",contained:""}},defaultVariants:{orientation:"horizontal",variant:"floating"},compoundVariants:[{orientation:"horizontal",variant:"contained",className:"h-full"},{orientation:"vertical",variant:"contained",className:"w-full"}]}),r=a(["nd-slider-range","absolute","rounded-full","bg-brand","pointer-events-none"],{variants:{orientation:{horizontal:["left-0","h-[var(--nd-slider-track-size)]"],vertical:["bottom-0","w-[var(--nd-slider-track-size)]"]},variant:{floating:"",contained:""}},defaultVariants:{orientation:"horizontal",variant:"floating"},compoundVariants:[{orientation:"horizontal",variant:"contained",className:"h-full"},{orientation:"vertical",variant:"contained",className:"w-full"}]}),o=a(["nd-slider-thumb","absolute","inline-flex","items-center","justify-center","rounded-full","text-[0.625rem]","leading-none","pointer-events-none","transition-[box-shadow]"],{variants:{orientation:{horizontal:["top-1/2","-translate-x-1/2","-translate-y-1/2"],vertical:["left-1/2","-translate-x-1/2","translate-y-1/2"]},size:{small:"",medium:"",large:""},variant:{floating:"",contained:""}},defaultVariants:{variant:"floating"},compoundVariants:[{variant:"floating",className:["size-[var(--nd-slider-thumb-size)]","box-border","border-2","border-brand","bg-brand-contrast","text-brand",e]},{variant:"contained",className:["box-content","aspect-square","border-2","border-canvas","bg-brand","text-brand-contrast",e]},{orientation:"horizontal",variant:"contained",className:"h-full"},{orientation:"vertical",variant:"contained",className:"w-full"}]}),l={slider:t,track:i,range:r,thumb:o};export{l as default};
package/dist/tailwind.css CHANGED
@@ -1 +1 @@
1
- @theme static{ --nd-brand-h: 255; --nd-brand-c: .14; --nd-neutral-c: .001; --nd-shadow-l: 15%; --nd-shadow-c: .008; --nd-color-brand-0: light-dark( oklch(99% calc(var(--nd-brand-c) * .08) var(--nd-brand-h)), oklch(14% calc(var(--nd-brand-c) * .08) var(--nd-brand-h)) ); --nd-color-brand-5: light-dark( oklch(97% calc(var(--nd-brand-c) * .12) var(--nd-brand-h)), oklch(17% calc(var(--nd-brand-c) * .12) var(--nd-brand-h)) ); --nd-color-brand-10: light-dark( oklch(95% calc(var(--nd-brand-c) * .18) var(--nd-brand-h)), oklch(20% calc(var(--nd-brand-c) * .18) var(--nd-brand-h)) ); --nd-color-brand-15: light-dark( oklch(92% calc(var(--nd-brand-c) * .24) var(--nd-brand-h)), oklch(25% calc(var(--nd-brand-c) * .24) var(--nd-brand-h)) ); --nd-color-brand-20: light-dark( oklch(88% calc(var(--nd-brand-c) * .34) var(--nd-brand-h)), oklch(30% calc(var(--nd-brand-c) * .34) var(--nd-brand-h)) ); --nd-color-brand-30: light-dark( oklch(80% calc(var(--nd-brand-c) * .5) var(--nd-brand-h)), oklch(38% calc(var(--nd-brand-c) * .5) var(--nd-brand-h)) ); --nd-color-brand-40: light-dark( oklch(72% calc(var(--nd-brand-c) * .68) var(--nd-brand-h)), oklch(46% calc(var(--nd-brand-c) * .68) var(--nd-brand-h)) ); --nd-color-brand-50: light-dark( oklch(64% calc(var(--nd-brand-c) * .86) var(--nd-brand-h)), oklch(52% calc(var(--nd-brand-c) * .86) var(--nd-brand-h)) ); --nd-color-brand-60: oklch(58% var(--nd-brand-c) var(--nd-brand-h)); --nd-color-brand-70: light-dark( oklch(50% calc(var(--nd-brand-c) * .94) var(--nd-brand-h)), oklch(66% calc(var(--nd-brand-c) * .94) var(--nd-brand-h)) ); --nd-color-brand-80: light-dark( oklch(40% calc(var(--nd-brand-c) * .78) var(--nd-brand-h)), oklch(76% calc(var(--nd-brand-c) * .78) var(--nd-brand-h)) ); --nd-color-brand-90: light-dark( oklch(30% calc(var(--nd-brand-c) * .55) var(--nd-brand-h)), oklch(88% calc(var(--nd-brand-c) * .55) var(--nd-brand-h)) ); --nd-color-brand-100: light-dark( oklch(20% calc(var(--nd-brand-c) * .36) var(--nd-brand-h)), oklch(96% calc(var(--nd-brand-c) * .36) var(--nd-brand-h)) ); --nd-color-neutral-0: light-dark( oklch(99% var(--nd-neutral-c) var(--nd-brand-h)), oklch(14% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-5: light-dark( oklch(97.5% var(--nd-neutral-c) var(--nd-brand-h)), oklch(17% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-10: light-dark( oklch(95.5% var(--nd-neutral-c) var(--nd-brand-h)), oklch(21% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-15: light-dark( oklch(92.5% var(--nd-neutral-c) var(--nd-brand-h)), oklch(26% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-20: light-dark( oklch(89% var(--nd-neutral-c) var(--nd-brand-h)), oklch(32% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-30: light-dark( oklch(81% var(--nd-neutral-c) var(--nd-brand-h)), oklch(42% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-40: light-dark( oklch(72% var(--nd-neutral-c) var(--nd-brand-h)), oklch(50% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-50: light-dark( oklch(60% var(--nd-neutral-c) var(--nd-brand-h)), oklch(58% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-60: light-dark( oklch(50% var(--nd-neutral-c) var(--nd-brand-h)), oklch(67% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-70: light-dark( oklch(40% var(--nd-neutral-c) var(--nd-brand-h)), oklch(76% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-80: light-dark( oklch(32% var(--nd-neutral-c) var(--nd-brand-h)), oklch(85% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-90: light-dark( oklch(22% var(--nd-neutral-c) var(--nd-brand-h)), oklch(93% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-100: light-dark( oklch(15% var(--nd-neutral-c) var(--nd-brand-h)), oklch(98% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-success-base: oklch(60% .14 140deg); --nd-color-warning-base: oklch(76% .15 80deg); --nd-color-error-base: oklch(58% .16 28deg); --nd-color-shadow-key: light-dark( oklch(var(--nd-shadow-l) var(--nd-shadow-c) var(--nd-brand-h) / 16%), oklch(0% 0 0deg / 65%) ); --nd-color-shadow-ambient: light-dark( oklch(var(--nd-shadow-l) var(--nd-shadow-c) var(--nd-brand-h) / 4%), oklch(0% 0 0deg / 30%) ); --nd-font-family: -apple-system, blinkmacsystemfont, "Segoe UI", roboto, "Helvetica Neue", arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; }@theme{ --color-brand: var(--nd-color-brand-60); --color-brand-hover: light-dark(var(--nd-color-brand-50), var(--nd-color-brand-70)); --color-brand-active: var(--nd-color-brand-60); --color-brand-muted: light-dark(var(--nd-color-brand-30), var(--nd-color-brand-40)); --color-brand-subtle: var(--nd-color-brand-10); --color-brand-subtle-hover: var(--nd-color-brand-15); --color-brand-subtle-active: var(--nd-color-brand-20); --color-brand-contrast: light-dark(var(--nd-color-neutral-0), var(--nd-color-neutral-100)); --color-success: color-mix(in oklch, var(--nd-color-success-base) 90%, var(--nd-color-brand-60) 10%); --color-success-hover: light-dark( oklch(from var(--color-success) calc(l + .06) calc(c*.86) h), oklch(from var(--color-success) calc(l + .08) calc(c*.94) h) ); --color-success-muted: light-dark( oklch(from var(--color-success) calc(1 - ((1 - l)*.476)) calc(c/2) h), oklch(from var(--color-success) calc(.14 + (l - .14)*.727) calc(c*.68) h) ); --color-success-subtle: light-dark( oklch(from var(--color-success) calc(1 - ((1 - l)*.119)) calc(c*.18) h), oklch(from var(--color-success) calc(.14 + (l - .14)*.136) calc(c*.18) h) ); --color-success-contrast: light-dark(var(--nd-color-neutral-0), var(--nd-color-neutral-100)); --color-warning: color-mix(in oklch, var(--nd-color-warning-base) 95%, var(--nd-color-brand-60) 5%); --color-warning-hover: light-dark( oklch(from var(--color-warning) calc(l + .06) calc(c*.86) h), oklch(from var(--color-warning) calc(l + .08) calc(c*.94) h) ); --color-warning-muted: light-dark( oklch(from var(--color-warning) calc(1 - ((1 - l)*.476)) calc(c/2) h), oklch(from var(--color-warning) calc(.14 + (l - .14)*.727) calc(c*.68) h) ); --color-warning-subtle: light-dark( oklch(from var(--color-warning) calc(1 - ((1 - l)*.119)) calc(c*.18) h), oklch(from var(--color-warning) calc(.14 + (l - .14)*.136) calc(c*.18) h) ); --color-warning-contrast: light-dark(var(--nd-color-neutral-100), var(--nd-color-neutral-0)); --color-error: color-mix(in oklch, var(--nd-color-error-base) 92%, var(--nd-color-brand-60) 8%); --color-error-hover: light-dark( oklch(from var(--color-error) calc(l + .06) calc(c*.86) h), oklch(from var(--color-error) calc(l + .08) calc(c*.94) h) ); --color-error-muted: light-dark( oklch(from var(--color-error) calc(1 - ((1 - l)*.476)) calc(c/2) h), oklch(from var(--color-error) calc(.14 + (l - .14)*.727) calc(c*.68) h) ); --color-error-subtle: light-dark( oklch(from var(--color-error) calc(1 - ((1 - l)*.119)) calc(c*.18) h), oklch(from var(--color-error) calc(.14 + (l - .14)*.136) calc(c*.18) h) ); --color-error-contrast: light-dark(var(--nd-color-neutral-0), var(--nd-color-neutral-100)); --border-color-main: var(--nd-color-neutral-20); --border-color-muted: var(--nd-color-neutral-15); --border-color-subtle: var(--nd-color-neutral-10); --outline-color-main: var(--border-color-main); --outline-color-muted: var(--border-color-muted); --outline-color-subtle: var(--border-color-subtle); --background-color-canvas: var(--nd-color-neutral-0); --background-color-canvas-inverse: var(--nd-color-neutral-100); --background-color-subtle: var(--nd-color-neutral-5); --background-color-subtle-hover: var(--nd-color-neutral-10); --background-color-muted: var(--nd-color-neutral-10); --background-color-muted-hover: var(--nd-color-neutral-15); --background-color-muted-active: var(--nd-color-neutral-20); --background-color-emphasized: var(--nd-color-neutral-20); --background-color-emphasized-hover: var(--nd-color-neutral-30); --background-color-surface: light-dark( var(--nd-color-neutral-0), var(--nd-color-neutral-10) ); --background-color-surface-subtle: light-dark(var(--nd-color-neutral-5), var(--nd-color-neutral-15)); --background-color-surface-muted: light-dark(var(--nd-color-neutral-10), var(--nd-color-neutral-20)); --text-color-main: var(--nd-color-neutral-100); --text-color-main-inverse: var(--nd-color-neutral-0); --text-color-muted: var(--nd-color-neutral-70); --text-color-subtle: var(--nd-color-neutral-50); --text-sm: .75rem; --text-sm--line-height: 1.25rem; --text-md: .875rem; --text-md--line-height: 1.375rem; --text-lg: 1rem; --text-lg--line-height: 1.5rem; --text-xl: 1.125rem; --text-xl--line-height: 1.625rem; --text-2xl: 1.25rem; --text-2xl--line-height: 1.75rem; --text-3xl: 1.5rem; --text-3xl--line-height: 2rem; --text-4xl: 1.875rem; --text-4xl--line-height: 2.375rem; --text-5xl: 2.375rem; --text-5xl--line-height: 2.875rem; --text-6xl: 2.875rem; --text-6xl--line-height: 3.375rem; --radius-xs: .125rem; --radius-sm: .25rem; --radius-md: .375rem; --radius-lg: .5rem; --radius-xl: .75rem; --radius-2xl: 1rem; --radius-3xl: 1.5rem; --z-index-popup: 1000; --z-index-modal: 1300; --z-index-toast: 1500; --shadow-sm: 0 0 0 .8px var(--border-color-muted), 0 1px 2px 0 var(--nd-color-shadow-key); --shadow-md: 0 0 0 .8px var(--border-color-muted), 0 4px 6px -1px var(--nd-color-shadow-key), 0 2px 4px -2px var(--nd-color-shadow-ambient); --shadow-lg: 0 0 0 .8px var(--border-color-muted), 0 10px 15px -3px var(--nd-color-shadow-key), 0 4px 6px -4px var(--nd-color-shadow-ambient); --shadow-xl: 0 0 0 .8px var(--border-color-muted), 0 20px 25px -5px var(--nd-color-shadow-key), 0 8px 10px -6px var(--nd-color-shadow-ambient); --shadow-2xl: 0 0 0 .8px var(--border-color-muted), 0 25px 50px -12px var(--nd-color-shadow-key), 0 12px 24px -12px var(--nd-color-shadow-ambient); --font-nd: var(--nd-font-family); --default-transition-duration: .2s; }@utility stroke-main{stroke: var(--border-color-main);}@utility stroke-muted{stroke: var(--border-color-muted);}@utility stroke-subtle{stroke: var(--border-color-subtle);}@utility underline{text-decoration: underline; text-underline-offset: .125rem;}@utility ring-focused{outline: none; box-shadow: 0 0 0 .2rem var(--color-brand-muted),var(--tw-shadow, 0 0 #00000000);}@utility ring-focused-with-outline{box-shadow: 0 0 0 .2rem var(--color-brand-muted),var(--tw-shadow, 0 0 #00000000);}@utility r-*{r: --value(number);}@custom-variant focus-visible-within{&:has(:focus-visible) {@slot;}}@custom-variant disabled{&:where(:disabled,[aria-disabled="true"],[data-disabled]) {@slot;}}@custom-variant disabled-visual{&:where(:disabled,[aria-disabled="true"],[data-disabled]):not(:where(.nd-disabled-carrier:where(:disabled,[aria-disabled="true"],[data-disabled])) :where(:disabled,[aria-disabled="true"],[data-disabled])) {@slot;}}@custom-variant enabled{&:not(:disabled,[aria-disabled="true"],[data-disabled]) {@slot;}}
1
+ @theme static{ --nd-brand-h: 255; --nd-brand-c: .14; --nd-neutral-c: .001; --nd-shadow-l: 15%; --nd-shadow-c: .008; --nd-color-brand-0: light-dark( oklch(99% calc(var(--nd-brand-c) * .08) var(--nd-brand-h)), oklch(14% calc(var(--nd-brand-c) * .08) var(--nd-brand-h)) ); --nd-color-brand-5: light-dark( oklch(97% calc(var(--nd-brand-c) * .12) var(--nd-brand-h)), oklch(17% calc(var(--nd-brand-c) * .12) var(--nd-brand-h)) ); --nd-color-brand-10: light-dark( oklch(95% calc(var(--nd-brand-c) * .18) var(--nd-brand-h)), oklch(20% calc(var(--nd-brand-c) * .18) var(--nd-brand-h)) ); --nd-color-brand-15: light-dark( oklch(92% calc(var(--nd-brand-c) * .24) var(--nd-brand-h)), oklch(25% calc(var(--nd-brand-c) * .24) var(--nd-brand-h)) ); --nd-color-brand-20: light-dark( oklch(88% calc(var(--nd-brand-c) * .34) var(--nd-brand-h)), oklch(30% calc(var(--nd-brand-c) * .34) var(--nd-brand-h)) ); --nd-color-brand-30: light-dark( oklch(80% calc(var(--nd-brand-c) * .5) var(--nd-brand-h)), oklch(38% calc(var(--nd-brand-c) * .5) var(--nd-brand-h)) ); --nd-color-brand-40: light-dark( oklch(72% calc(var(--nd-brand-c) * .68) var(--nd-brand-h)), oklch(46% calc(var(--nd-brand-c) * .68) var(--nd-brand-h)) ); --nd-color-brand-50: light-dark( oklch(64% calc(var(--nd-brand-c) * .86) var(--nd-brand-h)), oklch(52% calc(var(--nd-brand-c) * .86) var(--nd-brand-h)) ); --nd-color-brand-60: oklch(58% var(--nd-brand-c) var(--nd-brand-h)); --nd-color-brand-70: light-dark( oklch(50% calc(var(--nd-brand-c) * .94) var(--nd-brand-h)), oklch(66% calc(var(--nd-brand-c) * .94) var(--nd-brand-h)) ); --nd-color-brand-80: light-dark( oklch(40% calc(var(--nd-brand-c) * .78) var(--nd-brand-h)), oklch(76% calc(var(--nd-brand-c) * .78) var(--nd-brand-h)) ); --nd-color-brand-90: light-dark( oklch(30% calc(var(--nd-brand-c) * .55) var(--nd-brand-h)), oklch(88% calc(var(--nd-brand-c) * .55) var(--nd-brand-h)) ); --nd-color-brand-100: light-dark( oklch(20% calc(var(--nd-brand-c) * .36) var(--nd-brand-h)), oklch(96% calc(var(--nd-brand-c) * .36) var(--nd-brand-h)) ); --nd-color-neutral-0: light-dark( oklch(99% var(--nd-neutral-c) var(--nd-brand-h)), oklch(14% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-5: light-dark( oklch(97.5% var(--nd-neutral-c) var(--nd-brand-h)), oklch(17% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-10: light-dark( oklch(95.5% var(--nd-neutral-c) var(--nd-brand-h)), oklch(21% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-15: light-dark( oklch(92.5% var(--nd-neutral-c) var(--nd-brand-h)), oklch(26% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-20: light-dark( oklch(89% var(--nd-neutral-c) var(--nd-brand-h)), oklch(32% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-30: light-dark( oklch(81% var(--nd-neutral-c) var(--nd-brand-h)), oklch(42% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-40: light-dark( oklch(72% var(--nd-neutral-c) var(--nd-brand-h)), oklch(50% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-50: light-dark( oklch(60% var(--nd-neutral-c) var(--nd-brand-h)), oklch(58% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-60: light-dark( oklch(50% var(--nd-neutral-c) var(--nd-brand-h)), oklch(67% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-70: light-dark( oklch(40% var(--nd-neutral-c) var(--nd-brand-h)), oklch(76% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-80: light-dark( oklch(32% var(--nd-neutral-c) var(--nd-brand-h)), oklch(85% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-90: light-dark( oklch(22% var(--nd-neutral-c) var(--nd-brand-h)), oklch(93% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-neutral-100: light-dark( oklch(15% var(--nd-neutral-c) var(--nd-brand-h)), oklch(98% var(--nd-neutral-c) var(--nd-brand-h)) ); --nd-color-success-base: oklch(60% .14 140deg); --nd-color-warning-base: oklch(76% .15 80deg); --nd-color-error-base: oklch(58% .16 28deg); --nd-color-shadow-key: light-dark( oklch(var(--nd-shadow-l) var(--nd-shadow-c) var(--nd-brand-h) / 16%), oklch(0% 0 0deg / 65%) ); --nd-color-shadow-ambient: light-dark( oklch(var(--nd-shadow-l) var(--nd-shadow-c) var(--nd-brand-h) / 4%), oklch(0% 0 0deg / 30%) ); --nd-font-family: -apple-system, blinkmacsystemfont, "Segoe UI", roboto, "Helvetica Neue", arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; }@theme{ --color-brand: var(--nd-color-brand-60); --color-brand-hover: light-dark(var(--nd-color-brand-50), var(--nd-color-brand-70)); --color-brand-active: var(--nd-color-brand-60); --color-brand-muted: light-dark(var(--nd-color-brand-30), var(--nd-color-brand-40)); --color-brand-subtle: var(--nd-color-brand-10); --color-brand-subtle-hover: var(--nd-color-brand-15); --color-brand-subtle-active: var(--nd-color-brand-20); --color-brand-contrast: light-dark(var(--nd-color-neutral-0), var(--nd-color-neutral-100)); --color-success: color-mix(in oklch, var(--nd-color-success-base) 90%, var(--nd-color-brand-60) 10%); --color-success-hover: light-dark( oklch(from var(--color-success) calc(l + .06) calc(c*.86) h), oklch(from var(--color-success) calc(l + .08) calc(c*.94) h) ); --color-success-muted: light-dark( oklch(from var(--color-success) calc(1 - ((1 - l)*.476)) calc(c/2) h), oklch(from var(--color-success) calc(.14 + (l - .14)*.727) calc(c*.68) h) ); --color-success-subtle: light-dark( oklch(from var(--color-success) calc(1 - ((1 - l)*.119)) calc(c*.18) h), oklch(from var(--color-success) calc(.14 + (l - .14)*.136) calc(c*.18) h) ); --color-success-contrast: light-dark(var(--nd-color-neutral-0), var(--nd-color-neutral-100)); --color-warning: color-mix(in oklch, var(--nd-color-warning-base) 95%, var(--nd-color-brand-60) 5%); --color-warning-hover: light-dark( oklch(from var(--color-warning) calc(l + .06) calc(c*.86) h), oklch(from var(--color-warning) calc(l + .08) calc(c*.94) h) ); --color-warning-muted: light-dark( oklch(from var(--color-warning) calc(1 - ((1 - l)*.476)) calc(c/2) h), oklch(from var(--color-warning) calc(.14 + (l - .14)*.727) calc(c*.68) h) ); --color-warning-subtle: light-dark( oklch(from var(--color-warning) calc(1 - ((1 - l)*.119)) calc(c*.18) h), oklch(from var(--color-warning) calc(.14 + (l - .14)*.136) calc(c*.18) h) ); --color-warning-contrast: light-dark(var(--nd-color-neutral-100), var(--nd-color-neutral-0)); --color-error: color-mix(in oklch, var(--nd-color-error-base) 92%, var(--nd-color-brand-60) 8%); --color-error-hover: light-dark( oklch(from var(--color-error) calc(l + .06) calc(c*.86) h), oklch(from var(--color-error) calc(l + .08) calc(c*.94) h) ); --color-error-muted: light-dark( oklch(from var(--color-error) calc(1 - ((1 - l)*.476)) calc(c/2) h), oklch(from var(--color-error) calc(.14 + (l - .14)*.727) calc(c*.68) h) ); --color-error-subtle: light-dark( oklch(from var(--color-error) calc(1 - ((1 - l)*.119)) calc(c*.18) h), oklch(from var(--color-error) calc(.14 + (l - .14)*.136) calc(c*.18) h) ); --color-error-contrast: light-dark(var(--nd-color-neutral-0), var(--nd-color-neutral-100)); --border-color-main: var(--nd-color-neutral-20); --border-color-muted: var(--nd-color-neutral-15); --border-color-subtle: var(--nd-color-neutral-10); --border-color-canvas: var(--nd-color-neutral-0); --outline-color-main: var(--border-color-main); --outline-color-muted: var(--border-color-muted); --outline-color-subtle: var(--border-color-subtle); --background-color-canvas: var(--nd-color-neutral-0); --background-color-canvas-inverse: var(--nd-color-neutral-100); --background-color-subtle: var(--nd-color-neutral-5); --background-color-subtle-hover: var(--nd-color-neutral-10); --background-color-muted: var(--nd-color-neutral-10); --background-color-muted-hover: var(--nd-color-neutral-15); --background-color-muted-active: var(--nd-color-neutral-20); --background-color-emphasized: var(--nd-color-neutral-20); --background-color-emphasized-hover: var(--nd-color-neutral-30); --background-color-surface: light-dark( var(--nd-color-neutral-0), var(--nd-color-neutral-5) ); --text-color-main: var(--nd-color-neutral-100); --text-color-main-inverse: var(--nd-color-neutral-0); --text-color-muted: var(--nd-color-neutral-70); --text-color-subtle: var(--nd-color-neutral-50); --text-sm: .75rem; --text-sm--line-height: 1.25rem; --text-md: .875rem; --text-md--line-height: 1.375rem; --text-lg: 1rem; --text-lg--line-height: 1.5rem; --text-xl: 1.125rem; --text-xl--line-height: 1.625rem; --text-2xl: 1.25rem; --text-2xl--line-height: 1.75rem; --text-3xl: 1.5rem; --text-3xl--line-height: 2rem; --text-4xl: 1.875rem; --text-4xl--line-height: 2.375rem; --text-5xl: 2.375rem; --text-5xl--line-height: 2.875rem; --text-6xl: 2.875rem; --text-6xl--line-height: 3.375rem; --radius-xs: .125rem; --radius-sm: .25rem; --radius-md: .375rem; --radius-lg: .5rem; --radius-xl: .75rem; --radius-2xl: 1rem; --radius-3xl: 1.5rem; --z-index-popup: 1000; --z-index-modal: 1300; --z-index-toast: 1500; --shadow-sm: 0 0 0 .8px var(--border-color-muted), 0 1px 2px 0 var(--nd-color-shadow-key); --shadow-md: 0 0 0 .8px var(--border-color-muted), 0 4px 6px -1px var(--nd-color-shadow-key), 0 2px 4px -2px var(--nd-color-shadow-ambient); --shadow-lg: 0 0 0 .8px var(--border-color-muted), 0 10px 15px -3px var(--nd-color-shadow-key), 0 4px 6px -4px var(--nd-color-shadow-ambient); --shadow-xl: 0 0 0 .8px var(--border-color-muted), 0 20px 25px -5px var(--nd-color-shadow-key), 0 8px 10px -6px var(--nd-color-shadow-ambient); --shadow-2xl: 0 0 0 .8px var(--border-color-muted), 0 25px 50px -12px var(--nd-color-shadow-key), 0 12px 24px -12px var(--nd-color-shadow-ambient); --font-nd: var(--nd-font-family); --default-transition-duration: .2s; }@utility stroke-main{stroke: var(--border-color-main);}@utility stroke-muted{stroke: var(--border-color-muted);}@utility stroke-subtle{stroke: var(--border-color-subtle);}@utility underline{text-decoration: underline; text-underline-offset: .125rem;}@utility ring-focused{outline: none; box-shadow: 0 0 0 .2rem var(--color-brand-muted),var(--tw-shadow, 0 0 #00000000);}@utility ring-focused-with-outline{box-shadow: 0 0 0 .2rem var(--color-brand-muted),var(--tw-shadow, 0 0 #00000000);}@utility r-*{r: --value(number);}@custom-variant focus-visible-within{&:has(:focus-visible) {@slot;}}@custom-variant disabled{&:where(:disabled,[aria-disabled="true"],[data-disabled]) {@slot;}}@custom-variant disabled-visual{&:where(:disabled,[aria-disabled="true"],[data-disabled]):not(:where(.nd-disabled-carrier:where(:disabled,[aria-disabled="true"],[data-disabled])) :where(:disabled,[aria-disabled="true"],[data-disabled])) {@slot;}}@custom-variant enabled{&:not(:disabled,[aria-disabled="true"],[data-disabled]) {@slot;}}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nild/components",
3
3
  "private": false,
4
- "version": "0.0.54",
4
+ "version": "0.0.56",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
7
7
  "exports": {
@@ -26,7 +26,8 @@
26
26
  "NOTICE"
27
27
  ],
28
28
  "dependencies": {
29
- "@floating-ui/dom": "1.7.1"
29
+ "@floating-ui/dom": "1.7.1",
30
+ "culori": "^4.0.2"
30
31
  },
31
32
  "peerDependencies": {
32
33
  "react": "^18.2.0",