@codefast/ui 0.0.45 → 0.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-SCJ3W2VO.js → chunk-DTSAQICV.js} +2 -2
- package/dist/chunk-DTSAQICV.js.map +1 -0
- package/dist/{chunk-7HJV22OF.mjs → chunk-JOBEKA4M.mjs} +1 -1
- package/dist/{chunk-7HJV22OF.mjs.map → chunk-JOBEKA4M.mjs.map} +1 -1
- package/dist/{chunk-WYYOCZNI.mjs → chunk-KZ3CIZTP.mjs} +2 -2
- package/dist/{chunk-WYYOCZNI.mjs.map → chunk-KZ3CIZTP.mjs.map} +1 -1
- package/dist/{chunk-WL65TBKJ.mjs → chunk-MU2MZ434.mjs} +2 -2
- package/dist/{chunk-WL65TBKJ.mjs.map → chunk-MU2MZ434.mjs.map} +1 -1
- package/dist/{chunk-NSK74YTM.js → chunk-OP6Q7VT5.js} +2 -2
- package/dist/{chunk-NSK74YTM.js.map → chunk-OP6Q7VT5.js.map} +1 -1
- package/dist/{chunk-ELWITZPX.js → chunk-SDGUDONZ.js} +2 -2
- package/dist/{chunk-ELWITZPX.js.map → chunk-SDGUDONZ.js.map} +1 -1
- package/dist/{chunk-MZJL73RI.js → chunk-UYRRHPPH.js} +1 -1
- package/dist/{chunk-MZJL73RI.js.map → chunk-UYRRHPPH.js.map} +1 -1
- package/dist/{chunk-HX5YKP4E.mjs → chunk-XHNT6PVI.mjs} +2 -2
- package/dist/{chunk-HX5YKP4E.mjs.map → chunk-XHNT6PVI.mjs.map} +1 -1
- package/dist/hooks/use-media-query.js.map +1 -1
- package/dist/hooks/use-media-query.mjs.map +1 -1
- package/dist/hooks/use-mutation-observer.js.map +1 -1
- package/dist/hooks/use-mutation-observer.mjs.map +1 -1
- package/dist/plugin/base.plugin.js +1 -1
- package/dist/plugin/base.plugin.mjs +1 -1
- package/dist/react/alert-dialog.js.map +1 -1
- package/dist/react/alert-dialog.mjs.map +1 -1
- package/dist/react/checkbox-cards.js +1 -1
- package/dist/react/checkbox-cards.js.map +1 -1
- package/dist/react/checkbox-cards.mjs +1 -1
- package/dist/react/checkbox-cards.mjs.map +1 -1
- package/dist/react/checkbox-group.js +1 -1
- package/dist/react/checkbox-group.mjs +1 -1
- package/dist/react/checkbox-group.primitive.js +1 -1
- package/dist/react/checkbox-group.primitive.mjs +1 -1
- package/dist/react/command.js +1 -1
- package/dist/react/command.js.map +1 -1
- package/dist/react/command.mjs +1 -1
- package/dist/react/command.mjs.map +1 -1
- package/dist/react/context-menu.js +1 -1
- package/dist/react/context-menu.js.map +1 -1
- package/dist/react/context-menu.mjs +1 -1
- package/dist/react/context-menu.mjs.map +1 -1
- package/dist/react/data-table.js +1 -1
- package/dist/react/data-table.mjs +1 -1
- package/dist/react/dropdown-menu.js +1 -1
- package/dist/react/dropdown-menu.mjs +1 -1
- package/dist/react/menubar.js +1 -1
- package/dist/react/menubar.js.map +1 -1
- package/dist/react/menubar.mjs +1 -1
- package/dist/react/menubar.mjs.map +1 -1
- package/dist/react/radio-cards.js +1 -1
- package/dist/react/radio-cards.js.map +1 -1
- package/dist/react/radio-cards.mjs +1 -1
- package/dist/react/radio-cards.mjs.map +1 -1
- package/dist/react/select.js +1 -1
- package/dist/react/select.mjs +1 -1
- package/dist/react/tooltip.js +1 -1
- package/dist/react/tooltip.js.map +1 -1
- package/dist/react/tooltip.mjs +1 -1
- package/dist/react/tooltip.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/dist/tailwind.config.js +1 -1
- package/dist/tailwind.config.mjs +1 -1
- package/package.json +6 -6
- package/plugin/base.plugin.ts +0 -3
- package/src/hooks/use-media-query.ts +1 -0
- package/src/hooks/use-mutation-observer.ts +1 -0
- package/src/react/alert-dialog.tsx +1 -0
- package/src/react/checkbox-cards.tsx +1 -1
- package/src/react/checkbox-group.primitive.tsx +1 -0
- package/src/react/command.tsx +1 -1
- package/src/react/context-menu.tsx +4 -4
- package/src/react/dropdown-menu.tsx +4 -4
- package/src/react/menubar.tsx +5 -5
- package/src/react/radio-cards.tsx +1 -1
- package/src/react/select.tsx +3 -3
- package/src/react/tooltip.tsx +1 -1
- package/dist/chunk-SCJ3W2VO.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _plugin = require('tailwindcss/plugin'); var _plugin2 = _interopRequireDefault(_plugin);var
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _plugin = require('tailwindcss/plugin'); var _plugin2 = _interopRequireDefault(_plugin);var o=_plugin2.default.call(void 0, ({addBase:t})=>{t({".dark":{"color-scheme":"dark"},body:{"@apply bg-background text-foreground":""},":focus-visible":{"@apply outline-ring":""},"button, [role='button'], input:where([type='button']), input:where([type='reset']), input:where([type='submit'])":{"@apply outline-transparent":""}})}),p= exports.a =o;exports.a = p;
|
|
2
|
+
//# sourceMappingURL=chunk-DTSAQICV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../plugin/base.plugin.ts"],"names":["plugin","base","addBase","base_plugin_default"],"mappings":"AAAA,OAAOA,MAAY,qBAEnB,IAAMC,EAAOD,EAAO,CAAC,CAAE,QAAAE,CAAQ,IAAM,CACnCA,EAAQ,CACN,QAAS,CACP,eAAgB,MAClB,EACA,KAAM,CACJ,uCAAwC,EAC1C,EACA,iBAAkB,CAChB,sBAAuB,EACzB,EACA,mHACE,CACE,6BAA8B,EAChC,CACJ,CAAC,CACH,CAAC,EAEMC,EAAQF","sourcesContent":["import plugin from 'tailwindcss/plugin';\n\nconst base = plugin(({ addBase }) => {\n addBase({\n '.dark': {\n 'color-scheme': 'dark',\n },\n body: {\n '@apply bg-background text-foreground': '',\n },\n ':focus-visible': {\n '@apply outline-ring': '',\n },\n \"button, [role='button'], input:where([type='button']), input:where([type='reset']), input:where([type='submit'])\":\n {\n '@apply outline-transparent': '',\n },\n });\n});\n\nexport default base;\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import*as r from"react";import*as d from"@radix-ui/react-checkbox";import{createCheckboxScope as v}from"@radix-ui/react-checkbox";import{createContextScope as W}from"@radix-ui/react-context";import*as m from"@radix-ui/react-roving-focus";import{createRovingFocusGroupScope as R}from"@radix-ui/react-roving-focus";import{useControllableState as A}from"@radix-ui/react-use-controllable-state";import{useDirection as M}from"@radix-ui/react-direction";import{Primitive as O}from"@radix-ui/react-primitive";import{jsx as c}from"react/jsx-runtime";var a="CheckboxGroup",[w,L]=W(a,[R,v]),f=R(),G=v(),[D,T]=w(a),P=r.forwardRef(({__scopeCheckboxGroup:o,name:i,defaultValue:e,value:n,required:t=!1,disabled:p=!1,orientation:C,dir:h,loop:u=!0,onValueChange:l,...S},F)=>{let E=f(o),x=M(h),[N=[],s]=A({prop:n,defaultProp:e,onChange:l}),V=r.useCallback(k=>{s((b=[])=>[...b,k])},[s]),q=r.useCallback(k=>{s((b=[])=>b.filter(U=>U!==k))},[s]);return c(D,{scope:o,name:i,required:t,disabled:p,value:N,onItemCheck:V,onItemUncheck:q,children:c(m.Root,{asChild:!0,...E,orientation:C,dir:x,loop:u,children:c(O.div,{ref:F,role:"group","data-disabled":p?"":void 0,dir:x,...S})})})});P.displayName=a;var I=`${a}Item`,g=r.forwardRef(({__scopeCheckboxGroup:o,disabled:i,...e},n)=>{let t=T(I,o),p=t.disabled||i,C=f(o),h=G(o),u=t.value?.includes(e.value);return c(m.Item,{asChild:!0,...C,focusable:!p,active:u,children:c(d.Root,{ref:n,name:t.name,disabled:p,required:t.required,checked:u,...h,...e,onCheckedChange:l=>{l?t.onItemCheck(e.value):t.onItemUncheck(e.value)}})})});g.displayName=I;var $=`${a}Indicator`,y=r.forwardRef(({__scopeCheckboxGroup:o,...i},e)=>{let n=G(o);return c(d.Indicator,{ref:e,...n,...i})});y.displayName=$;var Q=P,Y=g,Z=y;export{L as a,P as b,g as c,y as d,Q as e,Y as f,Z as g};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
//# sourceMappingURL=chunk-JOBEKA4M.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/checkbox-group.primitive.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { createCheckboxScope } from '@radix-ui/react-checkbox';\nimport { createContextScope, type Scope } from '@radix-ui/react-context';\nimport * as RovingFocusGroup from '@radix-ui/react-roving-focus';\nimport { createRovingFocusGroupScope } from '@radix-ui/react-roving-focus';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Component: CheckboxGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_GROUP_NAME = 'CheckboxGroup';\n\ntype ScopedProps<P> = P & { __scopeCheckboxGroup?: Scope };\n\nconst [createCheckboxGroupContext, createCheckboxGroupScope] =\n createContextScope(CHECKBOX_GROUP_NAME, [\n createRovingFocusGroupScope,\n createCheckboxScope,\n ]);\n\nconst useRovingFocusGroupScope = createRovingFocusGroupScope();\nconst useCheckboxScope = createCheckboxScope();\n\ninterface CheckboxGroupContextValue {\n name?: string;\n required: boolean;\n disabled: boolean;\n value?: string[];\n onItemCheck: (value: string) => void;\n onItemUncheck: (value: string) => void;\n}\n\nconst [CheckboxGroupProvider, useCheckboxGroupContext] =\n createCheckboxGroupContext<CheckboxGroupContextValue>(CHECKBOX_GROUP_NAME);\n\ntype CheckboxGroupElement = React.ElementRef<typeof Primitive.div>;\n\ninterface CheckboxGroupProps\n extends React.ComponentPropsWithoutRef<typeof Primitive.div> {\n name?: CheckboxGroupContextValue['name'];\n required?: React.ComponentPropsWithoutRef<\n typeof CheckboxPrimitive.Root\n >['required'];\n disabled?: React.ComponentPropsWithoutRef<\n typeof CheckboxPrimitive.Root\n >['disabled'];\n dir?: RovingFocusGroup.RovingFocusGroupProps['dir'];\n orientation?: RovingFocusGroup.RovingFocusGroupProps['orientation'];\n loop?: RovingFocusGroup.RovingFocusGroupProps['loop'];\n defaultValue?: string[];\n value?: CheckboxGroupContextValue['value'];\n onValueChange?: (value: string[]) => void;\n}\n\nconst CheckboxGroup = React.forwardRef<\n CheckboxGroupElement,\n CheckboxGroupProps\n>(\n (\n {\n __scopeCheckboxGroup,\n name,\n defaultValue,\n value: valueProp,\n required = false,\n disabled = false,\n orientation,\n dir,\n loop = true,\n onValueChange,\n ...props\n }: ScopedProps<CheckboxGroupProps>,\n ref,\n ) => {\n const rovingFocusGroupScope =\n useRovingFocusGroupScope(__scopeCheckboxGroup);\n const direction = useDirection(dir);\n const [value = [], setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue,\n onChange: onValueChange,\n });\n\n const handleItemCheck = React.useCallback(\n (itemValue: string) => {\n setValue((prevValue = []) => [...prevValue, itemValue]);\n },\n [setValue],\n );\n\n const handleItemUncheck = React.useCallback(\n (itemValue: string) => {\n setValue((prevValue = []) =>\n prevValue.filter((val) => val !== itemValue),\n );\n },\n [setValue],\n );\n\n return (\n <CheckboxGroupProvider\n scope={__scopeCheckboxGroup}\n name={name}\n required={required}\n disabled={disabled}\n value={value}\n onItemCheck={handleItemCheck}\n onItemUncheck={handleItemUncheck}\n >\n <RovingFocusGroup.Root\n asChild\n {...rovingFocusGroupScope}\n orientation={orientation}\n dir={direction}\n loop={loop}\n >\n {/* eslint-disable-next-line react/jsx-pascal-case -- radix-ui */}\n <Primitive.div\n ref={ref}\n role=\"group\"\n data-disabled={disabled ? '' : undefined}\n dir={direction}\n {...props}\n />\n </RovingFocusGroup.Root>\n </CheckboxGroupProvider>\n );\n },\n);\n\nCheckboxGroup.displayName = CHECKBOX_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Component: CheckboxGroupItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = `${CHECKBOX_GROUP_NAME}Item`;\n\ntype CheckboxGroupItemElement = React.ElementRef<typeof CheckboxPrimitive.Root>;\n\ninterface CheckboxGroupItemProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>,\n 'checked' | 'defaultChecked' | 'onCheckedChange' | 'name'\n > {\n value: string;\n}\n\nconst CheckboxGroupItem = React.forwardRef<\n CheckboxGroupItemElement,\n CheckboxGroupItemProps\n>(\n (\n {\n __scopeCheckboxGroup,\n disabled,\n ...props\n }: ScopedProps<CheckboxGroupItemProps>,\n ref,\n ) => {\n const context = useCheckboxGroupContext(ITEM_NAME, __scopeCheckboxGroup);\n const isDisabled = context.disabled || disabled;\n const rovingFocusGroupScope =\n useRovingFocusGroupScope(__scopeCheckboxGroup);\n const checkboxScope = useCheckboxScope(__scopeCheckboxGroup);\n const checked = context.value?.includes(props.value);\n\n return (\n <RovingFocusGroup.Item\n asChild\n {...rovingFocusGroupScope}\n focusable={!isDisabled}\n active={checked}\n >\n <CheckboxPrimitive.Root\n ref={ref}\n name={context.name}\n disabled={isDisabled}\n required={context.required}\n checked={checked}\n {...checkboxScope}\n {...props}\n onCheckedChange={(checkedState) => {\n if (checkedState) {\n context.onItemCheck(props.value);\n } else {\n context.onItemUncheck(props.value);\n }\n }}\n />\n </RovingFocusGroup.Item>\n );\n },\n);\n\nCheckboxGroupItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Component: CheckboxGroupIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = `${CHECKBOX_GROUP_NAME}Indicator`;\n\ntype CheckboxGroupIndicatorElement = React.ElementRef<\n typeof CheckboxPrimitive.Indicator\n>;\ntype CheckboxGroupIndicatorProps = React.ComponentPropsWithoutRef<\n typeof CheckboxPrimitive.Indicator\n>;\n\nconst CheckboxGroupIndicator = React.forwardRef<\n CheckboxGroupIndicatorElement,\n CheckboxGroupIndicatorProps\n>(\n (\n {\n __scopeCheckboxGroup,\n ...props\n }: ScopedProps<CheckboxGroupIndicatorProps>,\n ref,\n ) => {\n const checkboxScope = useCheckboxScope(__scopeCheckboxGroup);\n return (\n <CheckboxPrimitive.Indicator ref={ref} {...checkboxScope} {...props} />\n );\n },\n);\n\nCheckboxGroupIndicator.displayName = INDICATOR_NAME;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nconst Root = CheckboxGroup;\nconst Item = CheckboxGroupItem;\nconst Indicator = CheckboxGroupIndicator;\n\nexport {\n createCheckboxGroupScope,\n CheckboxGroup,\n CheckboxGroupItem,\n CheckboxGroupIndicator,\n Root,\n Item,\n Indicator,\n type CheckboxGroupProps,\n type CheckboxGroupItemProps,\n type CheckboxGroupIndicatorProps,\n};\n"],"mappings":"AAAA,UAAYA,MAAW,QACvB,UAAYC,MAAuB,2BACnC,OAAS,uBAAAC,MAA2B,2BACpC,OAAS,sBAAAC,MAAsC,0BAC/C,UAAYC,MAAsB,+BAClC,OAAS,+BAAAC,MAAmC,+BAC5C,OAAS,wBAAAC,MAA4B,yCACrC,OAAS,gBAAAC,MAAoB,4BAC7B,OAAS,aAAAC,MAAiB,4BAiHhB,cAAAC,MAAA,oBA3GV,IAAMC,EAAsB,gBAItB,CAACC,EAA4BC,CAAwB,EACzDT,EAAmBO,EAAqB,CACtCL,EACAH,CACF,CAAC,EAEGW,EAA2BR,EAA4B,EACvDS,EAAmBZ,EAAoB,EAWvC,CAACa,EAAuBC,CAAuB,EACnDL,EAAsDD,CAAmB,EAqBrEO,EAAsB,aAI1B,CACE,CACE,qBAAAC,EACA,KAAAC,EACA,aAAAC,EACA,MAAOC,EACP,SAAAC,EAAW,GACX,SAAAC,EAAW,GACX,YAAAC,EACA,IAAAC,EACA,KAAAC,EAAO,GACP,cAAAC,EACA,GAA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C,IAAKoB,EACL,KAAMY,EAAQ,KACd,SAAUC,EACV,SAAUD,EAAQ,SAClB,QAASG,EACR,GAAGD,EACH,GAAGf,EACJ,gBAAkBiB,GAAiB,CAC7BA,EACFJ,EAAQ,YAAYb,EAAM,KAAK,EAE/Ba,EAAQ,cAAcb,EAAM,KAAK,CAErC,EACF,EACF,CAEJ,CACF,EAEAY,EAAkB,YAAcD,EAMhC,IAAMO,EAAiB,GAAGpC,CAAmB,YASvCqC,EAA+B,aAInC,CACE,CACE,qBAAA7B,EACA,GAAGU,CACL,EACAC,IACG,CACH,IAAMc,EAAgB7B,EAAiBI,CAAoB,EAC3D,OACET,EAAmB,YAAlB,CAA4B,IAAKoB,EAAM,GAAGc,EAAgB,GAAGf,EAAO,CAEzE,CACF,EAEAmB,EAAuB,YAAcD,EAMrC,IAAME,EAAO/B,EACPgC,EAAOT,EACPU,EAAYH","names":["React","CheckboxPrimitive","createCheckboxScope","createContextScope","RovingFocusGroup","createRovingFocusGroupScope","useControllableState","useDirection","Primitive","jsx","CHECKBOX_GROUP_NAME","createCheckboxGroupContext","createCheckboxGroupScope","useRovingFocusGroupScope","useCheckboxScope","CheckboxGroupProvider","useCheckboxGroupContext","CheckboxGroup","__scopeCheckboxGroup","name","defaultValue","valueProp","required","disabled","orientation","dir","loop","onValueChange","props","ref","rovingFocusGroupScope","direction","value","setValue","handleItemCheck","itemValue","prevValue","handleItemUncheck","val","ITEM_NAME","CheckboxGroupItem","context","isDisabled","checkboxScope","checked","checkedState","INDICATOR_NAME","CheckboxGroupIndicator","Root","Item","Indicator"]}
|
|
1
|
+
{"version":3,"sources":["../src/react/checkbox-group.primitive.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { createCheckboxScope } from '@radix-ui/react-checkbox';\nimport { createContextScope, type Scope } from '@radix-ui/react-context';\nimport * as RovingFocusGroup from '@radix-ui/react-roving-focus';\nimport { createRovingFocusGroupScope } from '@radix-ui/react-roving-focus';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Component: CheckboxGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_GROUP_NAME = 'CheckboxGroup';\n\ntype ScopedProps<P> = P & { __scopeCheckboxGroup?: Scope };\n\nconst [createCheckboxGroupContext, createCheckboxGroupScope] =\n createContextScope(CHECKBOX_GROUP_NAME, [\n createRovingFocusGroupScope,\n createCheckboxScope,\n ]);\n\nconst useRovingFocusGroupScope = createRovingFocusGroupScope();\nconst useCheckboxScope = createCheckboxScope();\n\ninterface CheckboxGroupContextValue {\n name?: string;\n required: boolean;\n disabled: boolean;\n value?: string[];\n onItemCheck: (value: string) => void;\n onItemUncheck: (value: string) => void;\n}\n\nconst [CheckboxGroupProvider, useCheckboxGroupContext] =\n createCheckboxGroupContext<CheckboxGroupContextValue>(CHECKBOX_GROUP_NAME);\n\ntype CheckboxGroupElement = React.ElementRef<typeof Primitive.div>;\n\ninterface CheckboxGroupProps\n extends React.ComponentPropsWithoutRef<typeof Primitive.div> {\n name?: CheckboxGroupContextValue['name'];\n required?: React.ComponentPropsWithoutRef<\n typeof CheckboxPrimitive.Root\n >['required'];\n disabled?: React.ComponentPropsWithoutRef<\n typeof CheckboxPrimitive.Root\n >['disabled'];\n dir?: RovingFocusGroup.RovingFocusGroupProps['dir'];\n orientation?: RovingFocusGroup.RovingFocusGroupProps['orientation'];\n loop?: RovingFocusGroup.RovingFocusGroupProps['loop'];\n defaultValue?: string[];\n value?: CheckboxGroupContextValue['value'];\n onValueChange?: (value: string[]) => void;\n}\n\nconst CheckboxGroup = React.forwardRef<\n CheckboxGroupElement,\n CheckboxGroupProps\n>(\n (\n {\n __scopeCheckboxGroup,\n name,\n defaultValue,\n value: valueProp,\n required = false,\n disabled = false,\n orientation,\n dir,\n loop = true,\n onValueChange,\n ...props\n }: ScopedProps<CheckboxGroupProps>,\n ref,\n ) => {\n const rovingFocusGroupScope =\n useRovingFocusGroupScope(__scopeCheckboxGroup);\n const direction = useDirection(dir);\n const [value = [], setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue,\n onChange: onValueChange,\n });\n\n const handleItemCheck = React.useCallback(\n (itemValue: string) => {\n setValue((prevValue = []) => [...prevValue, itemValue]);\n },\n [setValue],\n );\n\n const handleItemUncheck = React.useCallback(\n (itemValue: string) => {\n setValue((prevValue = []) =>\n prevValue.filter((val) => val !== itemValue),\n );\n },\n [setValue],\n );\n\n return (\n <CheckboxGroupProvider\n scope={__scopeCheckboxGroup}\n name={name}\n required={required}\n disabled={disabled}\n value={value}\n onItemCheck={handleItemCheck}\n onItemUncheck={handleItemUncheck}\n >\n <RovingFocusGroup.Root\n asChild\n {...rovingFocusGroupScope}\n orientation={orientation}\n dir={direction}\n loop={loop}\n >\n {/* eslint-disable-next-line react/jsx-pascal-case -- radix-ui */}\n <Primitive.div\n ref={ref}\n role=\"group\"\n data-disabled={disabled ? '' : undefined}\n dir={direction}\n {...props}\n />\n </RovingFocusGroup.Root>\n </CheckboxGroupProvider>\n );\n },\n);\n\nCheckboxGroup.displayName = CHECKBOX_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Component: CheckboxGroupItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = `${CHECKBOX_GROUP_NAME}Item`;\n\ntype CheckboxGroupItemElement = React.ElementRef<typeof CheckboxPrimitive.Root>;\n\ninterface CheckboxGroupItemProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>,\n 'checked' | 'defaultChecked' | 'onCheckedChange' | 'name'\n > {\n value: string;\n}\n\nconst CheckboxGroupItem = React.forwardRef<\n CheckboxGroupItemElement,\n CheckboxGroupItemProps\n>(\n (\n {\n __scopeCheckboxGroup,\n disabled,\n ...props\n }: ScopedProps<CheckboxGroupItemProps>,\n ref,\n ) => {\n const context = useCheckboxGroupContext(ITEM_NAME, __scopeCheckboxGroup);\n const isDisabled = context.disabled || disabled;\n const rovingFocusGroupScope =\n useRovingFocusGroupScope(__scopeCheckboxGroup);\n const checkboxScope = useCheckboxScope(__scopeCheckboxGroup);\n const checked = context.value?.includes(props.value);\n\n return (\n <RovingFocusGroup.Item\n asChild\n {...rovingFocusGroupScope}\n focusable={!isDisabled}\n active={checked}\n >\n <CheckboxPrimitive.Root\n ref={ref}\n name={context.name}\n disabled={isDisabled}\n required={context.required}\n checked={checked}\n {...checkboxScope}\n {...props}\n onCheckedChange={(checkedState) => {\n if (checkedState) {\n context.onItemCheck(props.value);\n } else {\n context.onItemUncheck(props.value);\n }\n }}\n />\n </RovingFocusGroup.Item>\n );\n },\n);\n\nCheckboxGroupItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Component: CheckboxGroupIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = `${CHECKBOX_GROUP_NAME}Indicator`;\n\ntype CheckboxGroupIndicatorElement = React.ElementRef<\n typeof CheckboxPrimitive.Indicator\n>;\ntype CheckboxGroupIndicatorProps = React.ComponentPropsWithoutRef<\n typeof CheckboxPrimitive.Indicator\n>;\n\nconst CheckboxGroupIndicator = React.forwardRef<\n CheckboxGroupIndicatorElement,\n CheckboxGroupIndicatorProps\n>(\n (\n {\n __scopeCheckboxGroup,\n ...props\n }: ScopedProps<CheckboxGroupIndicatorProps>,\n ref,\n ) => {\n const checkboxScope = useCheckboxScope(__scopeCheckboxGroup);\n\n return (\n <CheckboxPrimitive.Indicator ref={ref} {...checkboxScope} {...props} />\n );\n },\n);\n\nCheckboxGroupIndicator.displayName = INDICATOR_NAME;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nconst Root = CheckboxGroup;\nconst Item = CheckboxGroupItem;\nconst Indicator = CheckboxGroupIndicator;\n\nexport {\n createCheckboxGroupScope,\n CheckboxGroup,\n CheckboxGroupItem,\n CheckboxGroupIndicator,\n Root,\n Item,\n Indicator,\n type CheckboxGroupProps,\n type CheckboxGroupItemProps,\n type CheckboxGroupIndicatorProps,\n};\n"],"mappings":"AAAA,UAAYA,MAAW,QACvB,UAAYC,MAAuB,2BACnC,OAAS,uBAAAC,MAA2B,2BACpC,OAAS,sBAAAC,MAAsC,0BAC/C,UAAYC,MAAsB,+BAClC,OAAS,+BAAAC,MAAmC,+BAC5C,OAAS,wBAAAC,MAA4B,yCACrC,OAAS,gBAAAC,MAAoB,4BAC7B,OAAS,aAAAC,MAAiB,4BAiHhB,cAAAC,MAAA,oBA3GV,IAAMC,EAAsB,gBAItB,CAACC,EAA4BC,CAAwB,EACzDT,EAAmBO,EAAqB,CACtCL,EACAH,CACF,CAAC,EAEGW,EAA2BR,EAA4B,EACvDS,EAAmBZ,EAAoB,EAWvC,CAACa,EAAuBC,CAAuB,EACnDL,EAAsDD,CAAmB,EAqBrEO,EAAsB,aAI1B,CACE,CACE,qBAAAC,EACA,KAAAC,EACA,aAAAC,EACA,MAAOC,EACP,SAAAC,EAAW,GACX,SAAAC,EAAW,GACX,YAAAC,EACA,IAAAC,EACA,KAAAC,EAAO,GACP,cAAAC,EACA,GAAGC,CACL,EACAC,IACG,CACH,IAAMC,EACJjB,EAAyBK,CAAoB,EACzCa,EAAYxB,EAAakB,CAAG,EAC5B,CAACO,EAAQ,CAAC,EAAGC,CAAQ,EAAI3B,EAAqB,CAClD,KAAMe,EACN,YAAaD,EACb,SAAUO,CACZ,CAAC,EAEKO,EAAwB,cAC3BC,GAAsB,CACrBF,EAAS,CAACG,EAAY,CAAC,IAAM,CAAC,GAAGA,EAAWD,CAAS,CAAC,CACxD,EACA,CAACF,CAAQ,CACX,EAEMI,EAA0B,cAC7BF,GAAsB,CACrBF,EAAS,CAACG,EAAY,CAAC,IACrBA,EAAU,OAAQE,GAAQA,IAAQH,CAAS,CAC7C,CACF,EACA,CAACF,CAAQ,CACX,EAEA,OACExB,EAACM,E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,CACF,EAEAmB,EAAuB,YAAcD,EAMrC,IAAME,EAAO/B,EACPgC,EAAOT,EACPU,EAAYH","names":["React","CheckboxPrimitive","createCheckboxScope","createContextScope","RovingFocusGroup","createRovingFocusGroupScope","useControllableState","useDirection","Primitive","jsx","CHECKBOX_GROUP_NAME","createCheckboxGroupContext","createCheckboxGroupScope","useRovingFocusGroupScope","useCheckboxScope","CheckboxGroupProvider","useCheckboxGroupContext","CheckboxGroup","__scopeCheckboxGroup","name","defaultValue","valueProp","required","disabled","orientation","dir","loop","onValueChange","props","ref","rovingFocusGroupScope","direction","value","setValue","handleItemCheck","itemValue","prevValue","handleItemUncheck","val","ITEM_NAME","CheckboxGroupItem","context","isDisabled","checkboxScope","checked","checkedState","INDICATOR_NAME","CheckboxGroupIndicator","Root","Item","Indicator"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"tailwindcss/plugin";var
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import e from"tailwindcss/plugin";var o=e(({addBase:t})=>{t({".dark":{"color-scheme":"dark"},body:{"@apply bg-background text-foreground":""},":focus-visible":{"@apply outline-ring":""},"button, [role='button'], input:where([type='button']), input:where([type='reset']), input:where([type='submit'])":{"@apply outline-transparent":""}})}),p=o;export{p as a};
|
|
2
|
+
//# sourceMappingURL=chunk-KZ3CIZTP.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../plugin/base.plugin.ts"],"sourcesContent":["import plugin from 'tailwindcss/plugin';\n\nconst base = plugin(({ addBase }) => {\n addBase({\n '.dark': {\n 'color-scheme': 'dark',\n },\n body: {\n '@apply bg-background text-foreground': '',\n },\n ':focus-visible': {\n '@apply outline-ring': '',\n },\n \"button, [role='button'], input:where([type='button']), input:where([type='reset']), input:where([type='submit'])\":\n {\n '@apply outline-transparent': '',\n },\n
|
|
1
|
+
{"version":3,"sources":["../plugin/base.plugin.ts"],"sourcesContent":["import plugin from 'tailwindcss/plugin';\n\nconst base = plugin(({ addBase }) => {\n addBase({\n '.dark': {\n 'color-scheme': 'dark',\n },\n body: {\n '@apply bg-background text-foreground': '',\n },\n ':focus-visible': {\n '@apply outline-ring': '',\n },\n \"button, [role='button'], input:where([type='button']), input:where([type='reset']), input:where([type='submit'])\":\n {\n '@apply outline-transparent': '',\n },\n });\n});\n\nexport default base;\n"],"mappings":"AAAA,OAAOA,MAAY,qBAEnB,IAAMC,EAAOD,EAAO,CAAC,CAAE,QAAAE,CAAQ,IAAM,CACnCA,EAAQ,CACN,QAAS,CACP,eAAgB,MAClB,EACA,KAAM,CACJ,uCAAwC,EAC1C,EACA,iBAAkB,CAChB,sBAAuB,EACzB,EACA,mHACE,CACE,6BAA8B,EAChC,CACJ,CAAC,CACH,CAAC,EAEMC,EAAQF","names":["plugin","base","addBase","base_plugin_default"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as r}from"./chunk-LEUB3C3L.mjs";import*as a from"react";import{CaretSortIcon as S,CheckIcon as d,ChevronDownIcon as f,ChevronUpIcon as P}from"@radix-ui/react-icons";import*as e from"@radix-ui/react-select";import{jsx as t,jsxs as p}from"react/jsx-runtime";var h=e.Root,C=e.Group,N=e.Value,u=a.forwardRef(({children:
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as r}from"./chunk-LEUB3C3L.mjs";import*as a from"react";import{CaretSortIcon as S,CheckIcon as d,ChevronDownIcon as f,ChevronUpIcon as P}from"@radix-ui/react-icons";import*as e from"@radix-ui/react-select";import{jsx as t,jsxs as p}from"react/jsx-runtime";var h=e.Root,C=e.Group,N=e.Value,u=a.forwardRef(({children:i,className:l,...o},c)=>p(e.Trigger,{ref:c,className:r("border-input placeholder:text-muted-foreground flex h-10 w-full items-center justify-between gap-2 whitespace-nowrap rounded-md border bg-transparent px-3 text-sm shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:truncate",l),...o,children:[i,t(e.Icon,{asChild:!0,children:t(S,{className:"size-4 opacity-50"})})]}));u.displayName=e.Trigger.displayName;var n=a.forwardRef(({className:i,...l},o)=>t(e.ScrollUpButton,{ref:o,className:r("flex cursor-pointer items-center justify-center py-1",i),...l,children:t(P,{})}));n.displayName=e.ScrollUpButton.displayName;var s=a.forwardRef(({className:i,...l},o)=>t(e.ScrollDownButton,{ref:o,className:r("flex cursor-pointer items-center justify-center py-1",i),...l,children:t(f,{})}));s.displayName=e.ScrollDownButton.displayName;var y=a.forwardRef(({children:i,className:l,position:o="popper",...c},m)=>t(e.Portal,{children:p(e.Content,{ref:m,className:r("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=open]:fade-in data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border shadow-md",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",l),position:o,...c,children:[t(n,{}),t(e.Viewport,{className:r("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:i}),t(s,{})]})}));y.displayName=e.Content.displayName;var v=a.forwardRef(({className:i,...l},o)=>t(e.Label,{ref:o,className:r("px-2 py-1.5 text-sm font-semibold",i),...l}));v.displayName=e.Label.displayName;var R=a.forwardRef(({children:i,className:l,...o},c)=>p(e.Item,{ref:c,className:r("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",l),...o,children:[t("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:t(e.ItemIndicator,{children:t(d,{className:"size-4"})})}),t(e.ItemText,{children:i})]}));R.displayName=e.Item.displayName;var g=a.forwardRef(({className:i,...l},o)=>t(e.Separator,{ref:o,className:r("bg-muted -mx-1 my-1 h-px",i),...l}));g.displayName=e.Separator.displayName;export{h as a,C as b,N as c,u as d,n as e,s as f,y as g,v as h,R as i,g as j};
|
|
2
|
+
//# sourceMappingURL=chunk-MU2MZ434.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/select.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n CaretSortIcon,\n CheckIcon,\n ChevronDownIcon,\n ChevronUpIcon,\n} from '@radix-ui/react-icons';\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { cn } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: Select\n * -------------------------------------------------------------------------- */\n\ntype SelectProps = React.ComponentProps<typeof SelectPrimitive.Root>;\nconst Select = SelectPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectGroup\n * -------------------------------------------------------------------------- */\n\ntype SelectGroupProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Group\n>;\nconst SelectGroup = SelectPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectValue\n * -------------------------------------------------------------------------- */\n\ntype SelectValueProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Value\n>;\nconst SelectValue = SelectPrimitive.Value;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectTrigger\n * -------------------------------------------------------------------------- */\n\ntype SelectTriggerElement = React.ElementRef<typeof SelectPrimitive.Trigger>;\ntype SelectTriggerProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Trigger\n>;\n\nconst SelectTrigger = React.forwardRef<\n SelectTriggerElement,\n SelectTriggerProps\n>(({ children, className, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n 'border-input placeholder:text-muted-foreground flex h-10 w-full items-center justify-between gap-2 whitespace-nowrap rounded-md border bg-transparent px-3 text-sm shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:truncate',\n className,\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <CaretSortIcon className=\"size-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n));\n\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectScrollUpButton\n * -------------------------------------------------------------------------- */\n\ntype SelectScrollUpButtonElement = React.ElementRef<\n typeof SelectPrimitive.ScrollUpButton\n>;\ntype SelectScrollUpButtonProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.ScrollUpButton\n>;\n\nconst SelectScrollUpButton = React.forwardRef<\n SelectScrollUpButtonElement,\n SelectScrollUpButtonProps\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn(\n 'flex cursor-default items-center justify-center py-1',\n className,\n )}\n {...props}\n >\n <ChevronUpIcon />\n </SelectPrimitive.ScrollUpButton>\n));\n\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectScrollDownButton\n * -------------------------------------------------------------------------- */\n\ntype SelectScrollDownButtonElement = React.ElementRef<\n typeof SelectPrimitive.ScrollDownButton\n>;\ntype SelectScrollDownButtonProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.ScrollDownButton\n>;\n\nconst SelectScrollDownButton = React.forwardRef<\n SelectScrollDownButtonElement,\n SelectScrollDownButtonProps\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn(\n 'flex cursor-default items-center justify-center py-1',\n className,\n )}\n {...props}\n >\n <ChevronDownIcon />\n </SelectPrimitive.ScrollDownButton>\n));\n\nSelectScrollDownButton.displayName =\n SelectPrimitive.ScrollDownButton.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectContent\n * -------------------------------------------------------------------------- */\n\ntype SelectContentElement = React.ElementRef<typeof SelectPrimitive.Content>;\ntype SelectContentProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Content\n>;\n\nconst SelectContent = React.forwardRef<\n SelectContentElement,\n SelectContentProps\n>(({ children, className, position = 'popper', ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=open]:fade-in data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border shadow-md',\n position === 'popper' &&\n 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',\n className,\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1',\n position === 'popper' &&\n 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]',\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n));\n\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectLabel\n * -------------------------------------------------------------------------- */\n\ntype SelectLabelElement = React.ElementRef<typeof SelectPrimitive.Label>;\ntype SelectLabelProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Label\n>;\n\nconst SelectLabel = React.forwardRef<SelectLabelElement, SelectLabelProps>(\n ({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-sm font-semibold', className)}\n {...props}\n />\n ),\n);\n\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectItem\n * -------------------------------------------------------------------------- */\n\ntype SelectItemElement = React.ElementRef<typeof SelectPrimitive.Item>;\ntype SelectItemProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Item\n>;\n\nconst SelectItem = React.forwardRef<SelectItemElement, SelectItemProps>(\n ({ children, className, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex size-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n ),\n);\n\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectSeparator\n * -------------------------------------------------------------------------- */\n\ntype SelectSeparatorElement = React.ElementRef<\n typeof SelectPrimitive.Separator\n>;\ntype SelectSeparatorProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Separator\n>;\n\nconst SelectSeparator = React.forwardRef<\n SelectSeparatorElement,\n SelectSeparatorProps\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn('bg-muted -mx-1 my-1 h-px', className)}\n {...props}\n />\n));\n\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n type SelectProps,\n type SelectGroupProps,\n type SelectValueProps,\n type SelectTriggerProps,\n type SelectContentProps,\n type SelectLabelProps,\n type SelectItemProps,\n type SelectSeparatorProps,\n type SelectScrollUpButtonProps,\n type SelectScrollDownButtonProps,\n};\n"],"mappings":"yCAEA,UAAYA,MAAW,QACvB,OACE,iBAAAC,EACA,aAAAC,EACA,mBAAAC,EACA,iBAAAC,MACK,wBACP,UAAYC,MAAqB,yBAyC/B,OAUI,OAAAC,EAVJ,QAAAC,MAAA,oBAjCF,IAAMC,EAAyB,OASzBC,EAA8B,QAS9BC,EAA8B,QAW9BC,EAAsB,aAG1B,CAAC,CAAE,SAAAC,EAAU,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IACpCR,EAAiB,UAAhB,CACC,IAAKQ,EACL,UAAWC,EACT,oVACAH,CACF,EACC,GAAGC,EAEH,UAAAF,EACDN,EAAiB,OAAhB,CAAqB,QAAO,GAC3B,SAAAA,EAACW,EAAA,CAAc,UAAU,oBAAoB,EAC/C,GACF,CACD,EAEDN,EAAc,YAA8B,UAAQ,YAapD,IAAMO,EAA6B,aAGjC,CAAC,CAAE,UAAAL,EAAW,GAAGC,CAAM,EAAGC,IAC1BT,EAAiB,iBAAhB,CACC,IAAKS,EACL,UAAWC,EACT,uDACAH,CACF,EACC,GAAGC,EAEJ,SAAAR,EAACa,EAAA,EAAc,EACjB,C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a9C,IAAME,EAAwB,aAG5B,CAAC,CAAE,UAAAd,EAAW,GAAGC,CAAM,EAAGC,IAC1BT,EAAiB,YAAhB,CACC,IAAKS,EACL,UAAWC,EAAG,2BAA4BH,CAAS,EAClD,GAAGC,EACN,CACD,EAEDa,EAAgB,YAA8B,YAAU","names":["React","CaretSortIcon","CheckIcon","ChevronDownIcon","ChevronUpIcon","SelectPrimitive","jsx","jsxs","Select","SelectGroup","SelectValue","SelectTrigger","children","className","props","ref","cn","CaretSortIcon","SelectScrollUpButton","ChevronUpIcon","SelectScrollDownButton","ChevronDownIcon","SelectContent","position","SelectLabel","SelectItem","CheckIcon","SelectSeparator"]}
|
|
1
|
+
{"version":3,"sources":["../src/react/select.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n CaretSortIcon,\n CheckIcon,\n ChevronDownIcon,\n ChevronUpIcon,\n} from '@radix-ui/react-icons';\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { cn } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: Select\n * -------------------------------------------------------------------------- */\n\ntype SelectProps = React.ComponentProps<typeof SelectPrimitive.Root>;\nconst Select = SelectPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectGroup\n * -------------------------------------------------------------------------- */\n\ntype SelectGroupProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Group\n>;\nconst SelectGroup = SelectPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectValue\n * -------------------------------------------------------------------------- */\n\ntype SelectValueProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Value\n>;\nconst SelectValue = SelectPrimitive.Value;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectTrigger\n * -------------------------------------------------------------------------- */\n\ntype SelectTriggerElement = React.ElementRef<typeof SelectPrimitive.Trigger>;\ntype SelectTriggerProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Trigger\n>;\n\nconst SelectTrigger = React.forwardRef<\n SelectTriggerElement,\n SelectTriggerProps\n>(({ children, className, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n 'border-input placeholder:text-muted-foreground flex h-10 w-full items-center justify-between gap-2 whitespace-nowrap rounded-md border bg-transparent px-3 text-sm shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:truncate',\n className,\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <CaretSortIcon className=\"size-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n));\n\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectScrollUpButton\n * -------------------------------------------------------------------------- */\n\ntype SelectScrollUpButtonElement = React.ElementRef<\n typeof SelectPrimitive.ScrollUpButton\n>;\ntype SelectScrollUpButtonProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.ScrollUpButton\n>;\n\nconst SelectScrollUpButton = React.forwardRef<\n SelectScrollUpButtonElement,\n SelectScrollUpButtonProps\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn(\n 'flex cursor-pointer items-center justify-center py-1',\n className,\n )}\n {...props}\n >\n <ChevronUpIcon />\n </SelectPrimitive.ScrollUpButton>\n));\n\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectScrollDownButton\n * -------------------------------------------------------------------------- */\n\ntype SelectScrollDownButtonElement = React.ElementRef<\n typeof SelectPrimitive.ScrollDownButton\n>;\ntype SelectScrollDownButtonProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.ScrollDownButton\n>;\n\nconst SelectScrollDownButton = React.forwardRef<\n SelectScrollDownButtonElement,\n SelectScrollDownButtonProps\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn(\n 'flex cursor-pointer items-center justify-center py-1',\n className,\n )}\n {...props}\n >\n <ChevronDownIcon />\n </SelectPrimitive.ScrollDownButton>\n));\n\nSelectScrollDownButton.displayName =\n SelectPrimitive.ScrollDownButton.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectContent\n * -------------------------------------------------------------------------- */\n\ntype SelectContentElement = React.ElementRef<typeof SelectPrimitive.Content>;\ntype SelectContentProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Content\n>;\n\nconst SelectContent = React.forwardRef<\n SelectContentElement,\n SelectContentProps\n>(({ children, className, position = 'popper', ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=open]:fade-in data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border shadow-md',\n position === 'popper' &&\n 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',\n className,\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1',\n position === 'popper' &&\n 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]',\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n));\n\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectLabel\n * -------------------------------------------------------------------------- */\n\ntype SelectLabelElement = React.ElementRef<typeof SelectPrimitive.Label>;\ntype SelectLabelProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Label\n>;\n\nconst SelectLabel = React.forwardRef<SelectLabelElement, SelectLabelProps>(\n ({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-sm font-semibold', className)}\n {...props}\n />\n ),\n);\n\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectItem\n * -------------------------------------------------------------------------- */\n\ntype SelectItemElement = React.ElementRef<typeof SelectPrimitive.Item>;\ntype SelectItemProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Item\n>;\n\nconst SelectItem = React.forwardRef<SelectItemElement, SelectItemProps>(\n ({ children, className, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex size-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n ),\n);\n\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectSeparator\n * -------------------------------------------------------------------------- */\n\ntype SelectSeparatorElement = React.ElementRef<\n typeof SelectPrimitive.Separator\n>;\ntype SelectSeparatorProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Separator\n>;\n\nconst SelectSeparator = React.forwardRef<\n SelectSeparatorElement,\n SelectSeparatorProps\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn('bg-muted -mx-1 my-1 h-px', className)}\n {...props}\n />\n));\n\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n type SelectProps,\n type SelectGroupProps,\n type SelectValueProps,\n type SelectTriggerProps,\n type SelectContentProps,\n type SelectLabelProps,\n type SelectItemProps,\n type SelectSeparatorProps,\n type SelectScrollUpButtonProps,\n type SelectScrollDownButtonProps,\n};\n"],"mappings":"yCAEA,UAAYA,MAAW,QACvB,OACE,iBAAAC,EACA,aAAAC,EACA,mBAAAC,EACA,iBAAAC,MACK,wBACP,UAAYC,MAAqB,yBAyC/B,OAUI,OAAAC,EAVJ,QAAAC,MAAA,oBAjCF,IAAMC,EAAyB,OASzBC,EAA8B,QAS9BC,EAA8B,QAW9BC,EAAsB,aAG1B,CAAC,CAAE,SAAAC,EAAU,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IACpCR,EAAiB,UAAhB,CACC,IAAKQ,EACL,UAAWC,EACT,oVACAH,CACF,EACC,GAAGC,EAEH,UAAAF,EACDN,EAAiB,OAAhB,CAAqB,QAAO,GAC3B,SAAAA,EAACW,EAAA,CAAc,UAAU,oBAAoB,EAC/C,GACF,CACD,EAEDN,EAAc,YAA8B,UAAQ,YAapD,IAAMO,EAA6B,aAGjC,CAAC,CAAE,UAAAL,EAAW,GAAGC,CAAM,EAAGC,IAC1BT,EAAiB,iBAAhB,CACC,IAAKS,EACL,UAAWC,EACT,uDACAH,CACF,EACC,GAAGC,EAEJ,SAAAR,EAACa,EAAA,EAAc,EACjB,CACD,EAEDD,EAAqB,YAA8B,iBAAe,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AAE,UAAAd,EAAW,GAAGC,CAAM,EAAGC,IAC1BT,EAAiB,YAAhB,CACC,IAAKS,EACL,UAAWC,EAAG,2BAA4BH,CAAS,EAClD,GAAGC,EACN,CACD,EAEDa,EAAgB,YAA8B,YAAU","names":["React","CaretSortIcon","CheckIcon","ChevronDownIcon","ChevronUpIcon","SelectPrimitive","jsx","jsxs","Select","SelectGroup","SelectValue","SelectTrigger","children","className","props","ref","cn","CaretSortIcon","SelectScrollUpButton","ChevronUpIcon","SelectScrollDownButton","ChevronDownIcon","SelectContent","position","SelectLabel","SelectItem","CheckIcon","SelectSeparator"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkHQ4AUOQMjs = require('./chunk-HQ4AUOQM.js');var _react = require('react'); var
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkHQ4AUOQMjs = require('./chunk-HQ4AUOQM.js');var _react = require('react'); var a = _interopRequireWildcard(_react);var _reactdropdownmenu = require('@radix-ui/react-dropdown-menu'); var e = _interopRequireWildcard(_reactdropdownmenu);var _reacticons = require('@radix-ui/react-icons');var _jsxruntime = require('react/jsx-runtime');var g=e.Root,C= exports.b =e.Trigger,I= exports.c =e.Group,h= exports.d =e.Sub,S= exports.e =e.RadioGroup,l= exports.f =a.forwardRef(({children:o,className:t,inset:n,...i},d)=>_jsxruntime.jsxs.call(void 0, e.SubTrigger,{ref:d,className:_chunkHQ4AUOQMjs.b.call(void 0, "focus:bg-accent data-[state=open]:bg-accent flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none",n&&"pl-8",t),...i,children:[o,_jsxruntime.jsx.call(void 0, _reacticons.ChevronRightIcon,{className:"ml-auto size-4"})]}));l.displayName=e.SubTrigger.displayName;var w=a.forwardRef(({className:o,...t},n)=>_jsxruntime.jsx.call(void 0, e.Portal,{children:_jsxruntime.jsx.call(void 0, e.SubContent,{ref:n,className:_chunkHQ4AUOQMjs.b.call(void 0, "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-32 rounded-md border p-1 shadow-md",o),...t})}));w.displayName=e.SubContent.displayName;var M=a.forwardRef(({className:o,sideOffset:t=6,...n},i)=>_jsxruntime.jsx.call(void 0, e.Portal,{children:_jsxruntime.jsx.call(void 0, e.Content,{ref:i,sideOffset:t,className:_chunkHQ4AUOQMjs.b.call(void 0, "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-32 rounded-md border p-1 shadow-md",o),...n})}));M.displayName=e.Content.displayName;var f=a.forwardRef(({className:o,inset:t,...n},i)=>_jsxruntime.jsx.call(void 0, e.Item,{ref:i,className:_chunkHQ4AUOQMjs.b.call(void 0, "focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",t&&"pl-8",o),...n}));f.displayName=e.Item.displayName;var D=a.forwardRef(({children:o,className:t,checked:n,...i},d)=>_jsxruntime.jsxs.call(void 0, e.CheckboxItem,{ref:d,className:_chunkHQ4AUOQMjs.b.call(void 0, "focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",t),checked:n,...i,children:[_jsxruntime.jsx.call(void 0, "span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:_jsxruntime.jsx.call(void 0, e.ItemIndicator,{children:_jsxruntime.jsx.call(void 0, _reacticons.CheckIcon,{className:"size-4"})})}),o]}));D.displayName=e.CheckboxItem.displayName;var P=a.forwardRef(({children:o,className:t,...n},i)=>_jsxruntime.jsxs.call(void 0, e.RadioItem,{ref:i,className:_chunkHQ4AUOQMjs.b.call(void 0, "focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",t),...n,children:[_jsxruntime.jsx.call(void 0, "span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:_jsxruntime.jsx.call(void 0, e.ItemIndicator,{children:_jsxruntime.jsx.call(void 0, _reacticons.DotFilledIcon,{className:"size-4 fill-current"})})}),o]}));P.displayName=e.RadioItem.displayName;var y=a.forwardRef(({className:o,inset:t,...n},i)=>_jsxruntime.jsx.call(void 0, e.Label,{ref:i,className:_chunkHQ4AUOQMjs.b.call(void 0, "px-2 py-1.5 text-sm font-semibold",t&&"pl-8",o),...n}));y.displayName=e.Label.displayName;var R=a.forwardRef(({className:o,...t},n)=>_jsxruntime.jsx.call(void 0, e.Separator,{ref:n,className:_chunkHQ4AUOQMjs.b.call(void 0, "bg-muted -mx-1 my-1 h-px",o),...t}));R.displayName=e.Separator.displayName;function x({className:o,...t}){return _jsxruntime.jsx.call(void 0, "span",{className:_chunkHQ4AUOQMjs.b.call(void 0, "ml-auto text-xs tracking-widest opacity-60",o),...t})}exports.a = g; exports.b = C; exports.c = I; exports.d = h; exports.e = S; exports.f = l; exports.g = w; exports.h = M; exports.i = f; exports.j = D; exports.k = P; exports.l = y; exports.m = R; exports.n = x;
|
|
2
|
+
//# sourceMappingURL=chunk-OP6Q7VT5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/dropdown-menu.tsx"],"names":["React","DropdownMenuPrimitive","CheckIcon","ChevronRightIcon","DotFilledIcon","jsx","jsxs","DropdownMenu","DropdownMenuTrigger","DropdownMenuGroup","DropdownMenuSub","DropdownMenuRadioGroup","DropdownMenuSubTrigger","children","className","inset","props","ref","cn","DropdownMenuSubContent","DropdownMenuContent","sideOffset","DropdownMenuItem","DropdownMenuCheckboxItem","checked","DropdownMenuRadioItem","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut"],"mappings":"wCAEA,UAAYA,MAAW,QACvB,UAAYC,MAA2B,gCACvC,OACE,aAAAC,EACA,oBAAAC,EACA,iBAAAC,MACK,wBAmEL,OAUE,OAAAC,EAVF,QAAAC,MAAA,oBAzDF,IAAMC,EAAqC,OASrCC,EAA4C,UAS5CC,EAA0C,QAS1CC,EAAwC,MASxCC,EAA+C,aAiB/CC,EAA+B,aAGnC,CAAC,CAAE,SAAAC,EAAU,U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U,EAAyB,YACD,eAAa,YAarC,IAAME,EAA8B,aAGlC,CAAC,CAAE,SAAAZ,EAAU,UAAAC,EAAW,GAAGE,CAAM,EAAGC,IACpCX,EAAuB,YAAtB,CACC,IAAKW,EACL,UAAWC,EACT,kOACAJ,CACF,EACC,GAAGE,EAEJ,UAAAX,EAAC,QAAK,UAAU,4DACd,SAAAA,EAAuB,gBAAtB,CACC,SAAAA,EAACD,EAAA,CAAc,UAAU,sBAAsB,EACjD,EACF,EACCS,GACH,CACD,EAEDY,EAAsB,YAAoC,YAAU,YAepE,IAAMC,EAA0B,aAG9B,CAAC,CAAE,UAAAZ,EAAW,MAAAC,EAAO,GAAGC,CAAM,EAAGC,IACjCZ,EAAuB,QAAtB,CACC,IAAKY,EACL,UAAWC,EACT,oCACAH,GAAS,OACTD,CACF,EACC,GAAGE,EACN,CACD,EAEDU,EAAkB,YAAoC,QAAM,YAa5D,IAAMC,EAA8B,aAGlC,CAAC,CAAE,UAAAb,EAAW,GAAGE,CAAM,EAAGC,IAC1BZ,EAAuB,YAAtB,CACC,IAAKY,EACL,UAAWC,EAAG,2BAA4BJ,CAAS,EAClD,GAAGE,EACN,CACD,EAEDW,EAAsB,YAAoC,YAAU,YAQpE,SAASC,EAAqB,CAC5B,UAAAd,EACA,GAAGE,CACL,EAAiD,CAC/C,OACEX,EAAC,QACC,UAAWa,EAAG,6CAA8CJ,CAAS,EACpE,GAAGE,EACN,CAEJ","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport {\n CheckIcon,\n ChevronRightIcon,\n DotFilledIcon,\n} from '@radix-ui/react-icons';\nimport { cn } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenu\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuProps = React.ComponentProps<\n typeof DropdownMenuPrimitive.Root\n>;\nconst DropdownMenu = DropdownMenuPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuTrigger\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuTriggerProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Trigger\n>;\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuGroup\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuGroupProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Group\n>;\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSub\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuSubProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Sub\n>;\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuRadioGroupProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.RadioGroup\n>;\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuSubTriggerElement = React.ElementRef<\n typeof DropdownMenuPrimitive.SubTrigger\n>;\n\ninterface DropdownMenuSubTriggerProps\n extends React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.SubTrigger\n > {\n inset?: boolean;\n}\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n DropdownMenuSubTriggerElement,\n DropdownMenuSubTriggerProps\n>(({ children, className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'focus:bg-accent data-[state=open]:bg-accent flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\n\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubContent\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuSubContentProps =\n DropdownMenuPrimitive.DropdownMenuSubContentProps;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n DropdownMenuSubContentProps\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-32 rounded-md border p-1 shadow-md',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\n\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuContent\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuContentElement = React.ElementRef<\n typeof DropdownMenuPrimitive.Content\n>;\ntype DropdownMenuContentProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Content\n>;\n\nconst DropdownMenuContent = React.forwardRef<\n DropdownMenuContentElement,\n DropdownMenuContentProps\n>(({ className, sideOffset = 6, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-32 rounded-md border p-1 shadow-md',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\n\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuItem\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuItemElement = React.ElementRef<\n typeof DropdownMenuPrimitive.Item\n>;\n\ninterface DropdownMenuItemProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> {\n inset?: boolean;\n}\n\nconst DropdownMenuItem = React.forwardRef<\n DropdownMenuItemElement,\n DropdownMenuItemProps\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n));\n\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuCheckboxItem\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuCheckboxItemElement = React.ElementRef<\n typeof DropdownMenuPrimitive.CheckboxItem\n>;\ntype DropdownMenuCheckboxItemProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.CheckboxItem\n>;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n DropdownMenuCheckboxItemElement,\n DropdownMenuCheckboxItemProps\n>(({ children, className, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\n\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuRadioItem\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuRadioItemElement = React.ElementRef<\n typeof DropdownMenuPrimitive.RadioItem\n>;\ntype DropdownMenuRadioItemProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.RadioItem\n>;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n DropdownMenuRadioItemElement,\n DropdownMenuRadioItemProps\n>(({ children, className, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <DotFilledIcon className=\"size-4 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\n\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuLabel\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuLabelElement = React.ElementRef<\n typeof DropdownMenuPrimitive.Label\n>;\n\ninterface DropdownMenuLabelProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> {\n inset?: boolean;\n}\n\nconst DropdownMenuLabel = React.forwardRef<\n DropdownMenuLabelElement,\n DropdownMenuLabelProps\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n 'px-2 py-1.5 text-sm font-semibold',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n));\n\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSeparator\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuSeparatorElement = React.ElementRef<\n typeof DropdownMenuPrimitive.Separator\n>;\ntype DropdownMenuSeparatorProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Separator\n>;\n\nconst DropdownMenuSeparator = React.forwardRef<\n DropdownMenuSeparatorElement,\n DropdownMenuSeparatorProps\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn('bg-muted -mx-1 my-1 h-px', className)}\n {...props}\n />\n));\n\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuShortcut\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuShortcutProps = React.HTMLAttributes<HTMLSpanElement>;\n\nfunction DropdownMenuShortcut({\n className,\n ...props\n}: DropdownMenuShortcutProps): React.JSX.Element {\n return (\n <span\n className={cn('ml-auto text-xs tracking-widest opacity-60', className)}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n type DropdownMenuProps,\n type DropdownMenuTriggerProps,\n type DropdownMenuContentProps,\n type DropdownMenuItemProps,\n type DropdownMenuCheckboxItemProps,\n type DropdownMenuRadioItemProps,\n type DropdownMenuLabelProps,\n type DropdownMenuSeparatorProps,\n type DropdownMenuShortcutProps,\n type DropdownMenuGroupProps,\n type DropdownMenuSubProps,\n type DropdownMenuSubContentProps,\n type DropdownMenuSubTriggerProps,\n type DropdownMenuRadioGroupProps,\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/react/dropdown-menu.tsx"],"names":["React","DropdownMenuPrimitive","CheckIcon","ChevronRightIcon","DotFilledIcon","jsx","jsxs","DropdownMenu","DropdownMenuTrigger","DropdownMenuGroup","DropdownMenuSub","DropdownMenuRadioGroup","DropdownMenuSubTrigger","children","className","inset","props","ref","cn","DropdownMenuSubContent","DropdownMenuContent","sideOffset","DropdownMenuItem","DropdownMenuCheckboxItem","checked","DropdownMenuRadioItem","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut"],"mappings":"wCAEA,UAAYA,MAAW,QACvB,UAAYC,MAA2B,gCACvC,OACE,aAAAC,EACA,oBAAAC,EACA,iBAAAC,MACK,wBAmEL,OAUE,OAAAC,EAVF,QAAAC,MAAA,oBAzDF,IAAMC,EAAqC,OASrCC,EAA4C,UAS5CC,EAA0C,QAS1CC,EAAwC,MASxCC,EAA+C,aAiB/CC,EAA+B,aAGnC,CAAC,CAAE,SAAAC,EAAU,UAAAC,EAAW,MAAAC,EAAO,GAAGC,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EAA8B,aAGlC,CAAC,CAAE,SAAAZ,EAAU,UAAAC,EAAW,GAAGE,CAAM,EAAGC,IACpCX,EAAuB,YAAtB,CACC,IAAKW,EACL,UAAWC,EACT,kOACAJ,CACF,EACC,GAAGE,EAEJ,UAAAX,EAAC,QAAK,UAAU,4DACd,SAAAA,EAAuB,gBAAtB,CACC,SAAAA,EAACD,EAAA,CAAc,UAAU,sBAAsB,EACjD,EACF,EACCS,GACH,CACD,EAEDY,EAAsB,YAAoC,YAAU,YAepE,IAAMC,EAA0B,aAG9B,CAAC,CAAE,UAAAZ,EAAW,MAAAC,EAAO,GAAGC,CAAM,EAAGC,IACjCZ,EAAuB,QAAtB,CACC,IAAKY,EACL,UAAWC,EACT,oCACAH,GAAS,OACTD,CACF,EACC,GAAGE,EACN,CACD,EAEDU,EAAkB,YAAoC,QAAM,YAa5D,IAAMC,EAA8B,aAGlC,CAAC,CAAE,UAAAb,EAAW,GAAGE,CAAM,EAAGC,IAC1BZ,EAAuB,YAAtB,CACC,IAAKY,EACL,UAAWC,EAAG,2BAA4BJ,CAAS,EAClD,GAAGE,EACN,CACD,EAEDW,EAAsB,YAAoC,YAAU,YAQpE,SAASC,EAAqB,CAC5B,UAAAd,EACA,GAAGE,CACL,EAAiD,CAC/C,OACEX,EAAC,QACC,UAAWa,EAAG,6CAA8CJ,CAAS,EACpE,GAAGE,EACN,CAEJ","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport {\n CheckIcon,\n ChevronRightIcon,\n DotFilledIcon,\n} from '@radix-ui/react-icons';\nimport { cn } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenu\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuProps = React.ComponentProps<\n typeof DropdownMenuPrimitive.Root\n>;\nconst DropdownMenu = DropdownMenuPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuTrigger\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuTriggerProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Trigger\n>;\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuGroup\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuGroupProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Group\n>;\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSub\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuSubProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Sub\n>;\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuRadioGroupProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.RadioGroup\n>;\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuSubTriggerElement = React.ElementRef<\n typeof DropdownMenuPrimitive.SubTrigger\n>;\n\ninterface DropdownMenuSubTriggerProps\n extends React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.SubTrigger\n > {\n inset?: boolean;\n}\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n DropdownMenuSubTriggerElement,\n DropdownMenuSubTriggerProps\n>(({ children, className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'focus:bg-accent data-[state=open]:bg-accent flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\n\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubContent\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuSubContentProps =\n DropdownMenuPrimitive.DropdownMenuSubContentProps;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n DropdownMenuSubContentProps\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-32 rounded-md border p-1 shadow-md',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\n\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuContent\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuContentElement = React.ElementRef<\n typeof DropdownMenuPrimitive.Content\n>;\ntype DropdownMenuContentProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Content\n>;\n\nconst DropdownMenuContent = React.forwardRef<\n DropdownMenuContentElement,\n DropdownMenuContentProps\n>(({ className, sideOffset = 6, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-32 rounded-md border p-1 shadow-md',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\n\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuItem\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuItemElement = React.ElementRef<\n typeof DropdownMenuPrimitive.Item\n>;\n\ninterface DropdownMenuItemProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> {\n inset?: boolean;\n}\n\nconst DropdownMenuItem = React.forwardRef<\n DropdownMenuItemElement,\n DropdownMenuItemProps\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n));\n\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuCheckboxItem\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuCheckboxItemElement = React.ElementRef<\n typeof DropdownMenuPrimitive.CheckboxItem\n>;\ntype DropdownMenuCheckboxItemProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.CheckboxItem\n>;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n DropdownMenuCheckboxItemElement,\n DropdownMenuCheckboxItemProps\n>(({ children, className, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\n\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuRadioItem\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuRadioItemElement = React.ElementRef<\n typeof DropdownMenuPrimitive.RadioItem\n>;\ntype DropdownMenuRadioItemProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.RadioItem\n>;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n DropdownMenuRadioItemElement,\n DropdownMenuRadioItemProps\n>(({ children, className, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <DotFilledIcon className=\"size-4 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\n\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuLabel\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuLabelElement = React.ElementRef<\n typeof DropdownMenuPrimitive.Label\n>;\n\ninterface DropdownMenuLabelProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> {\n inset?: boolean;\n}\n\nconst DropdownMenuLabel = React.forwardRef<\n DropdownMenuLabelElement,\n DropdownMenuLabelProps\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n 'px-2 py-1.5 text-sm font-semibold',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n));\n\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSeparator\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuSeparatorElement = React.ElementRef<\n typeof DropdownMenuPrimitive.Separator\n>;\ntype DropdownMenuSeparatorProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Separator\n>;\n\nconst DropdownMenuSeparator = React.forwardRef<\n DropdownMenuSeparatorElement,\n DropdownMenuSeparatorProps\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn('bg-muted -mx-1 my-1 h-px', className)}\n {...props}\n />\n));\n\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuShortcut\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuShortcutProps = React.HTMLAttributes<HTMLSpanElement>;\n\nfunction DropdownMenuShortcut({\n className,\n ...props\n}: DropdownMenuShortcutProps): React.JSX.Element {\n return (\n <span\n className={cn('ml-auto text-xs tracking-widest opacity-60', className)}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n type DropdownMenuProps,\n type DropdownMenuTriggerProps,\n type DropdownMenuContentProps,\n type DropdownMenuItemProps,\n type DropdownMenuCheckboxItemProps,\n type DropdownMenuRadioItemProps,\n type DropdownMenuLabelProps,\n type DropdownMenuSeparatorProps,\n type DropdownMenuShortcutProps,\n type DropdownMenuGroupProps,\n type DropdownMenuSubProps,\n type DropdownMenuSubContentProps,\n type DropdownMenuSubTriggerProps,\n type DropdownMenuRadioGroupProps,\n};\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkHQ4AUOQMjs = require('./chunk-HQ4AUOQM.js');var _react = require('react'); var a = _interopRequireWildcard(_react);var _reacticons = require('@radix-ui/react-icons');var _reactselect = require('@radix-ui/react-select'); var e = _interopRequireWildcard(_reactselect);var _jsxruntime = require('react/jsx-runtime');var h=e.Root,C= exports.b =e.Group,N= exports.c =e.Value,u= exports.d =a.forwardRef(({children:
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkHQ4AUOQMjs = require('./chunk-HQ4AUOQM.js');var _react = require('react'); var a = _interopRequireWildcard(_react);var _reacticons = require('@radix-ui/react-icons');var _reactselect = require('@radix-ui/react-select'); var e = _interopRequireWildcard(_reactselect);var _jsxruntime = require('react/jsx-runtime');var h=e.Root,C= exports.b =e.Group,N= exports.c =e.Value,u= exports.d =a.forwardRef(({children:i,className:l,...o},c)=>_jsxruntime.jsxs.call(void 0, e.Trigger,{ref:c,className:_chunkHQ4AUOQMjs.b.call(void 0, "border-input placeholder:text-muted-foreground flex h-10 w-full items-center justify-between gap-2 whitespace-nowrap rounded-md border bg-transparent px-3 text-sm shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:truncate",l),...o,children:[i,_jsxruntime.jsx.call(void 0, e.Icon,{asChild:!0,children:_jsxruntime.jsx.call(void 0, _reacticons.CaretSortIcon,{className:"size-4 opacity-50"})})]}));u.displayName=e.Trigger.displayName;var n=a.forwardRef(({className:i,...l},o)=>_jsxruntime.jsx.call(void 0, e.ScrollUpButton,{ref:o,className:_chunkHQ4AUOQMjs.b.call(void 0, "flex cursor-pointer items-center justify-center py-1",i),...l,children:_jsxruntime.jsx.call(void 0, _reacticons.ChevronUpIcon,{})}));n.displayName=e.ScrollUpButton.displayName;var s=a.forwardRef(({className:i,...l},o)=>_jsxruntime.jsx.call(void 0, e.ScrollDownButton,{ref:o,className:_chunkHQ4AUOQMjs.b.call(void 0, "flex cursor-pointer items-center justify-center py-1",i),...l,children:_jsxruntime.jsx.call(void 0, _reacticons.ChevronDownIcon,{})}));s.displayName=e.ScrollDownButton.displayName;var y=a.forwardRef(({children:i,className:l,position:o="popper",...c},m)=>_jsxruntime.jsx.call(void 0, e.Portal,{children:_jsxruntime.jsxs.call(void 0, e.Content,{ref:m,className:_chunkHQ4AUOQMjs.b.call(void 0, "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=open]:fade-in data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border shadow-md",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",l),position:o,...c,children:[_jsxruntime.jsx.call(void 0, n,{}),_jsxruntime.jsx.call(void 0, e.Viewport,{className:_chunkHQ4AUOQMjs.b.call(void 0, "p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:i}),_jsxruntime.jsx.call(void 0, s,{})]})}));y.displayName=e.Content.displayName;var v=a.forwardRef(({className:i,...l},o)=>_jsxruntime.jsx.call(void 0, e.Label,{ref:o,className:_chunkHQ4AUOQMjs.b.call(void 0, "px-2 py-1.5 text-sm font-semibold",i),...l}));v.displayName=e.Label.displayName;var R=a.forwardRef(({children:i,className:l,...o},c)=>_jsxruntime.jsxs.call(void 0, e.Item,{ref:c,className:_chunkHQ4AUOQMjs.b.call(void 0, "focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",l),...o,children:[_jsxruntime.jsx.call(void 0, "span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:_jsxruntime.jsx.call(void 0, e.ItemIndicator,{children:_jsxruntime.jsx.call(void 0, _reacticons.CheckIcon,{className:"size-4"})})}),_jsxruntime.jsx.call(void 0, e.ItemText,{children:i})]}));R.displayName=e.Item.displayName;var g=a.forwardRef(({className:i,...l},o)=>_jsxruntime.jsx.call(void 0, e.Separator,{ref:o,className:_chunkHQ4AUOQMjs.b.call(void 0, "bg-muted -mx-1 my-1 h-px",i),...l}));g.displayName=e.Separator.displayName;exports.a = h; exports.b = C; exports.c = N; exports.d = u; exports.e = n; exports.f = s; exports.g = y; exports.h = v; exports.i = R; exports.j = g;
|
|
2
|
+
//# sourceMappingURL=chunk-SDGUDONZ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/select.tsx"],"names":["React","CaretSortIcon","CheckIcon","ChevronDownIcon","ChevronUpIcon","SelectPrimitive","jsx","jsxs","Select","SelectGroup","SelectValue","SelectTrigger","children","className","props","ref","cn","SelectScrollUpButton","SelectScrollDownButton","SelectContent","position","SelectLabel","SelectItem","SelectSeparator"],"mappings":"wCAEA,UAAYA,MAAW,QACvB,OACE,iBAAAC,EACA,aAAAC,EACA,mBAAAC,EACA,iBAAAC,MACK,wBACP,UAAYC,MAAqB,yBAyC/B,OAUI,OAAAC,EAVJ,QAAAC,MAAA,oBAjCF,IAAMC,EAAyB,OASzBC,EAA8B,QAS9BC,EAA8B,QAW9BC,EAAsB,aAG1B,CAAC,CAAE,SAAAC,EAAU,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IACpCR,EAAiB,UAAhB,CACC,IAAKQ,EACL,UAAWC,EACT,oVACAH,CACF,EACC,GAAGC,EAEH,UAAAF,EACDN,EAAiB,OAAhB,CAAqB,QAAO,GAC3B,SAAAA,EAACL,EAAA,CAAc,UAAU,oBAAoB,EAC/C,GACF,CACD,EAEDU,EAAc,YAA8B,UAAQ,YAapD,IAAMM,EAA6B,aAGjC,CAAC,CAAE,UAAAJ,EAAW,GAAGC,CAAM,EAAGC,IAC1BT,EAAiB,iBAAhB,CACC,IAAKS,EACL,UAAWC,EACT,uDACAH,CACF,E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AM,EAAS,GACtC,CAEJ,EAEAU,EAAW,YAA8B,OAAK,YAa9C,IAAMC,EAAwB,aAG5B,CAAC,CAAE,UAAAV,EAAW,GAAGC,CAAM,EAAGC,IAC1BT,EAAiB,YAAhB,CACC,IAAKS,EACL,UAAWC,EAAG,2BAA4BH,CAAS,EAClD,GAAGC,EACN,CACD,EAEDS,EAAgB,YAA8B,YAAU","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n CaretSortIcon,\n CheckIcon,\n ChevronDownIcon,\n ChevronUpIcon,\n} from '@radix-ui/react-icons';\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { cn } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: Select\n * -------------------------------------------------------------------------- */\n\ntype SelectProps = React.ComponentProps<typeof SelectPrimitive.Root>;\nconst Select = SelectPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectGroup\n * -------------------------------------------------------------------------- */\n\ntype SelectGroupProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Group\n>;\nconst SelectGroup = SelectPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectValue\n * -------------------------------------------------------------------------- */\n\ntype SelectValueProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Value\n>;\nconst SelectValue = SelectPrimitive.Value;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectTrigger\n * -------------------------------------------------------------------------- */\n\ntype SelectTriggerElement = React.ElementRef<typeof SelectPrimitive.Trigger>;\ntype SelectTriggerProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Trigger\n>;\n\nconst SelectTrigger = React.forwardRef<\n SelectTriggerElement,\n SelectTriggerProps\n>(({ children, className, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n 'border-input placeholder:text-muted-foreground flex h-10 w-full items-center justify-between gap-2 whitespace-nowrap rounded-md border bg-transparent px-3 text-sm shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:truncate',\n className,\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <CaretSortIcon className=\"size-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n));\n\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectScrollUpButton\n * -------------------------------------------------------------------------- */\n\ntype SelectScrollUpButtonElement = React.ElementRef<\n typeof SelectPrimitive.ScrollUpButton\n>;\ntype SelectScrollUpButtonProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.ScrollUpButton\n>;\n\nconst SelectScrollUpButton = React.forwardRef<\n SelectScrollUpButtonElement,\n SelectScrollUpButtonProps\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn(\n 'flex cursor-default items-center justify-center py-1',\n className,\n )}\n {...props}\n >\n <ChevronUpIcon />\n </SelectPrimitive.ScrollUpButton>\n));\n\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectScrollDownButton\n * -------------------------------------------------------------------------- */\n\ntype SelectScrollDownButtonElement = React.ElementRef<\n typeof SelectPrimitive.ScrollDownButton\n>;\ntype SelectScrollDownButtonProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.ScrollDownButton\n>;\n\nconst SelectScrollDownButton = React.forwardRef<\n SelectScrollDownButtonElement,\n SelectScrollDownButtonProps\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn(\n 'flex cursor-default items-center justify-center py-1',\n className,\n )}\n {...props}\n >\n <ChevronDownIcon />\n </SelectPrimitive.ScrollDownButton>\n));\n\nSelectScrollDownButton.displayName =\n SelectPrimitive.ScrollDownButton.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectContent\n * -------------------------------------------------------------------------- */\n\ntype SelectContentElement = React.ElementRef<typeof SelectPrimitive.Content>;\ntype SelectContentProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Content\n>;\n\nconst SelectContent = React.forwardRef<\n SelectContentElement,\n SelectContentProps\n>(({ children, className, position = 'popper', ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=open]:fade-in data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border shadow-md',\n position === 'popper' &&\n 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',\n className,\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1',\n position === 'popper' &&\n 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]',\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n));\n\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectLabel\n * -------------------------------------------------------------------------- */\n\ntype SelectLabelElement = React.ElementRef<typeof SelectPrimitive.Label>;\ntype SelectLabelProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Label\n>;\n\nconst SelectLabel = React.forwardRef<SelectLabelElement, SelectLabelProps>(\n ({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-sm font-semibold', className)}\n {...props}\n />\n ),\n);\n\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectItem\n * -------------------------------------------------------------------------- */\n\ntype SelectItemElement = React.ElementRef<typeof SelectPrimitive.Item>;\ntype SelectItemProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Item\n>;\n\nconst SelectItem = React.forwardRef<SelectItemElement, SelectItemProps>(\n ({ children, className, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex size-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n ),\n);\n\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectSeparator\n * -------------------------------------------------------------------------- */\n\ntype SelectSeparatorElement = React.ElementRef<\n typeof SelectPrimitive.Separator\n>;\ntype SelectSeparatorProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Separator\n>;\n\nconst SelectSeparator = React.forwardRef<\n SelectSeparatorElement,\n SelectSeparatorProps\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn('bg-muted -mx-1 my-1 h-px', className)}\n {...props}\n />\n));\n\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n type SelectProps,\n type SelectGroupProps,\n type SelectValueProps,\n type SelectTriggerProps,\n type SelectContentProps,\n type SelectLabelProps,\n type SelectItemProps,\n type SelectSeparatorProps,\n type SelectScrollUpButtonProps,\n type SelectScrollDownButtonProps,\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/react/select.tsx"],"names":["React","CaretSortIcon","CheckIcon","ChevronDownIcon","ChevronUpIcon","SelectPrimitive","jsx","jsxs","Select","SelectGroup","SelectValue","SelectTrigger","children","className","props","ref","cn","SelectScrollUpButton","SelectScrollDownButton","SelectContent","position","SelectLabel","SelectItem","SelectSeparator"],"mappings":"wCAEA,UAAYA,MAAW,QACvB,OACE,iBAAAC,EACA,aAAAC,EACA,mBAAAC,EACA,iBAAAC,MACK,wBACP,UAAYC,MAAqB,yBAyC/B,OAUI,OAAAC,EAVJ,QAAAC,MAAA,oBAjCF,IAAMC,EAAyB,OASzBC,EAA8B,QAS9BC,EAA8B,QAW9BC,EAAsB,aAG1B,CAAC,CAAE,SAAAC,EAAU,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IACpCR,EAAiB,UAAhB,CACC,IAAKQ,EACL,UAAWC,EACT,oVACAH,CACF,EACC,GAAGC,EAEH,UAAAF,EACDN,EAAiB,OAAhB,CAAqB,QAAO,GAC3B,SAAAA,EAACL,EAAA,CAAc,UAAU,oBAAoB,EAC/C,GACF,CACD,EAEDU,EAAc,YAA8B,UAAQ,YAapD,IAAMM,EAA6B,aAGjC,CAAC,CAAE,UAAAJ,EAAW,GAAGC,CAAM,EAAGC,IAC1BT,EAAiB,iBAAhB,CACC,IAAKS,EACL,UAAWC,EACT,uDACAH,CACF,EACC,GAAGC,EAEJ,SAAAR,EAACF,EAAA,EAAc,EACjB,CACD,EAEDa,EAAqB,YAA8B,iBA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AAC,CAAE,UAAAV,EAAW,GAAGC,CAAM,EAAGC,IAC1BT,EAAiB,YAAhB,CACC,IAAKS,EACL,UAAWC,EAAG,2BAA4BH,CAAS,EAClD,GAAGC,EACN,CACD,EAEDS,EAAgB,YAA8B,YAAU","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n CaretSortIcon,\n CheckIcon,\n ChevronDownIcon,\n ChevronUpIcon,\n} from '@radix-ui/react-icons';\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { cn } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: Select\n * -------------------------------------------------------------------------- */\n\ntype SelectProps = React.ComponentProps<typeof SelectPrimitive.Root>;\nconst Select = SelectPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectGroup\n * -------------------------------------------------------------------------- */\n\ntype SelectGroupProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Group\n>;\nconst SelectGroup = SelectPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectValue\n * -------------------------------------------------------------------------- */\n\ntype SelectValueProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Value\n>;\nconst SelectValue = SelectPrimitive.Value;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectTrigger\n * -------------------------------------------------------------------------- */\n\ntype SelectTriggerElement = React.ElementRef<typeof SelectPrimitive.Trigger>;\ntype SelectTriggerProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Trigger\n>;\n\nconst SelectTrigger = React.forwardRef<\n SelectTriggerElement,\n SelectTriggerProps\n>(({ children, className, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n 'border-input placeholder:text-muted-foreground flex h-10 w-full items-center justify-between gap-2 whitespace-nowrap rounded-md border bg-transparent px-3 text-sm shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:truncate',\n className,\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <CaretSortIcon className=\"size-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n));\n\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectScrollUpButton\n * -------------------------------------------------------------------------- */\n\ntype SelectScrollUpButtonElement = React.ElementRef<\n typeof SelectPrimitive.ScrollUpButton\n>;\ntype SelectScrollUpButtonProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.ScrollUpButton\n>;\n\nconst SelectScrollUpButton = React.forwardRef<\n SelectScrollUpButtonElement,\n SelectScrollUpButtonProps\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn(\n 'flex cursor-pointer items-center justify-center py-1',\n className,\n )}\n {...props}\n >\n <ChevronUpIcon />\n </SelectPrimitive.ScrollUpButton>\n));\n\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectScrollDownButton\n * -------------------------------------------------------------------------- */\n\ntype SelectScrollDownButtonElement = React.ElementRef<\n typeof SelectPrimitive.ScrollDownButton\n>;\ntype SelectScrollDownButtonProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.ScrollDownButton\n>;\n\nconst SelectScrollDownButton = React.forwardRef<\n SelectScrollDownButtonElement,\n SelectScrollDownButtonProps\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn(\n 'flex cursor-pointer items-center justify-center py-1',\n className,\n )}\n {...props}\n >\n <ChevronDownIcon />\n </SelectPrimitive.ScrollDownButton>\n));\n\nSelectScrollDownButton.displayName =\n SelectPrimitive.ScrollDownButton.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectContent\n * -------------------------------------------------------------------------- */\n\ntype SelectContentElement = React.ElementRef<typeof SelectPrimitive.Content>;\ntype SelectContentProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Content\n>;\n\nconst SelectContent = React.forwardRef<\n SelectContentElement,\n SelectContentProps\n>(({ children, className, position = 'popper', ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=open]:fade-in data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border shadow-md',\n position === 'popper' &&\n 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',\n className,\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1',\n position === 'popper' &&\n 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]',\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n));\n\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectLabel\n * -------------------------------------------------------------------------- */\n\ntype SelectLabelElement = React.ElementRef<typeof SelectPrimitive.Label>;\ntype SelectLabelProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Label\n>;\n\nconst SelectLabel = React.forwardRef<SelectLabelElement, SelectLabelProps>(\n ({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-sm font-semibold', className)}\n {...props}\n />\n ),\n);\n\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectItem\n * -------------------------------------------------------------------------- */\n\ntype SelectItemElement = React.ElementRef<typeof SelectPrimitive.Item>;\ntype SelectItemProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Item\n>;\n\nconst SelectItem = React.forwardRef<SelectItemElement, SelectItemProps>(\n ({ children, className, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex size-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n ),\n);\n\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectSeparator\n * -------------------------------------------------------------------------- */\n\ntype SelectSeparatorElement = React.ElementRef<\n typeof SelectPrimitive.Separator\n>;\ntype SelectSeparatorProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Separator\n>;\n\nconst SelectSeparator = React.forwardRef<\n SelectSeparatorElement,\n SelectSeparatorProps\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn('bg-muted -mx-1 my-1 h-px', className)}\n {...props}\n />\n));\n\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n type SelectProps,\n type SelectGroupProps,\n type SelectValueProps,\n type SelectTriggerProps,\n type SelectContentProps,\n type SelectLabelProps,\n type SelectItemProps,\n type SelectSeparatorProps,\n type SelectScrollUpButtonProps,\n type SelectScrollDownButtonProps,\n};\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _react = require('react'); var r = _interopRequireWildcard(_react);var _reactcheckbox = require('@radix-ui/react-checkbox'); var d = _interopRequireWildcard(_reactcheckbox);var _reactcontext = require('@radix-ui/react-context');var _reactrovingfocus = require('@radix-ui/react-roving-focus'); var m = _interopRequireWildcard(_reactrovingfocus);var _reactusecontrollablestate = require('@radix-ui/react-use-controllable-state');var _reactdirection = require('@radix-ui/react-direction');var _reactprimitive = require('@radix-ui/react-primitive');var _jsxruntime = require('react/jsx-runtime');var a="CheckboxGroup",[w,L]=_reactcontext.createContextScope.call(void 0, a,[_reactrovingfocus.createRovingFocusGroupScope,_reactcheckbox.createCheckboxScope]),f=_reactrovingfocus.createRovingFocusGroupScope.call(void 0, ),G=_reactcheckbox.createCheckboxScope.call(void 0, ),[D,T]=w(a),P= exports.b =r.forwardRef(({__scopeCheckboxGroup:o,name:i,defaultValue:e,value:n,required:t=!1,disabled:p=!1,orientation:C,dir:h,loop:u=!0,onValueChange:l,...S},F)=>{let E=f(o),x=_reactdirection.useDirection.call(void 0, h),[N=[],s]=_reactusecontrollablestate.useControllableState.call(void 0, {prop:n,defaultProp:e,onChange:l}),V=r.useCallback(k=>{s((b=[])=>[...b,k])},[s]),q=r.useCallback(k=>{s((b=[])=>b.filter(U=>U!==k))},[s]);return _jsxruntime.jsx.call(void 0, D,{scope:o,name:i,required:t,disabled:p,value:N,onItemCheck:V,onItemUncheck:q,children:_jsxruntime.jsx.call(void 0, m.Root,{asChild:!0,...E,orientation:C,dir:x,loop:u,children:_jsxruntime.jsx.call(void 0, _reactprimitive.Primitive.div,{ref:F,role:"group","data-disabled":p?"":void 0,dir:x,...S})})})});P.displayName=a;var I=`${a}Item`,g= exports.c =r.forwardRef(({__scopeCheckboxGroup:o,disabled:i,...e},n)=>{let t=T(I,o),p=t.disabled||i,C=f(o),h=G(o),u=_optionalChain([t, 'access', _ => _.value, 'optionalAccess', _2 => _2.includes, 'call', _3 => _3(e.value)]);return _jsxruntime.jsx.call(void 0, m.Item,{asChild:!0,...C,focusable:!p,active:u,children:_jsxruntime.jsx.call(void 0, d.Root,{ref:n,name:t.name,disabled:p,required:t.required,checked:u,...h,...e,onCheckedChange:l=>{l?t.onItemCheck(e.value):t.onItemUncheck(e.value)}})})});g.displayName=I;var $=`${a}Indicator`,y= exports.d =r.forwardRef(({__scopeCheckboxGroup:o,...i},e)=>{let n=G(o);return _jsxruntime.jsx.call(void 0, d.Indicator,{ref:e,...n,...i})});y.displayName=$;var Q=P,Y= exports.f =g,Z= exports.g =y;exports.a = L; exports.b = P; exports.c = g; exports.d = y; exports.e = Q; exports.f = Y; exports.g = Z;
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
//# sourceMappingURL=chunk-UYRRHPPH.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/checkbox-group.primitive.tsx"],"names":["React","CheckboxPrimitive","createCheckboxScope","createContextScope","RovingFocusGroup","createRovingFocusGroupScope","useControllableState","useDirection","Primitive","jsx","CHECKBOX_GROUP_NAME","createCheckboxGroupContext","createCheckboxGroupScope","useRovingFocusGroupScope","useCheckboxScope","CheckboxGroupProvider","useCheckboxGroupContext","CheckboxGroup","__scopeCheckboxGroup","name","defaultValue","valueProp","required","disabled","orientation","dir","loop","onValueChange","props","ref","rovingFocusGroupScope","direction","value","setValue","handleItemCheck","itemValue","prevValue","handleItemUncheck","val","ITEM_NAME","CheckboxGroupItem","context","isDisabled","checkboxScope","checked","checkedState","INDICATOR_NAME","CheckboxGroupIndicator","Root","Item","Indicator"],"mappings":"AAAA,UAAYA,MAAW,QACvB,UAAYC,MAAuB,2BACnC,OAAS,uBAAAC,MAA2B,2BACpC,OAAS,sBAAAC,MAAsC,0BAC/C,UAAYC,MAAsB,+BAClC,OAAS,+BAAAC,MAAmC,+BAC5C,OAAS,wBAAAC,MAA4B,yCACrC,OAAS,gBAAAC,MAAoB,4BAC7B,OAAS,aAAAC,MAAiB,4BAiHhB,cAAAC,MAAA,oBA3GV,IAAMC,EAAsB,gBAItB,CAACC,EAA4BC,CAAwB,EACzDT,EAAmBO,EAAqB,CACtCL,EACAH,CACF,CAAC,EAEGW,EAA2BR,EAA4B,EACvDS,EAAmBZ,EAAoB,EAWvC,CAACa,EAAuBC,CAAuB,EACnDL,EAAsDD,CAAmB,EAqBrEO,EAAsB,aAI1B,CACE,CACE,qBAAAC,EACA,KAAAC,EACA,aAAAC,EACA,MAAOC,EACP,SAAAC,EAAW,GACX,SAAAC,EAAW,GACX,YAAAC,EACA,IAAAC,EACA,KAAAC,EAAO,GACP,cAAAC,EACA,GAAGC,CACL,EACAC,IACG,CACH,IAAMC,EACJjB,EAAyBK,CAAoB,EACzCa,EAAYxB,EAAakB,CAAG,EAC5B,CAACO,EAAQ,CAAC,EAAGC,CAAQ,EAAI3B,EAAqB,CAClD,KAAMe,EACN,YAAaD,EAC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/Ba,EAAQ,cAAcb,EAAM,KAAK,CAErC,EACF,EACF,CAEJ,CACF,EAEAY,EAAkB,YAAcD,EAMhC,IAAMO,EAAiB,GAAGpC,CAAmB,YASvCqC,EAA+B,aAInC,CACE,CACE,qBAAA7B,EACA,GAAGU,CACL,EACAC,IACG,CACH,IAAMc,EAAgB7B,EAAiBI,CAAoB,EAC3D,OACET,EAAmB,YAAlB,CAA4B,IAAKoB,EAAM,GAAGc,EAAgB,GAAGf,EAAO,CAEzE,CACF,EAEAmB,EAAuB,YAAcD,EAMrC,IAAME,EAAO/B,EACPgC,EAAOT,EACPU,EAAYH","sourcesContent":["import * as React from 'react';\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { createCheckboxScope } from '@radix-ui/react-checkbox';\nimport { createContextScope, type Scope } from '@radix-ui/react-context';\nimport * as RovingFocusGroup from '@radix-ui/react-roving-focus';\nimport { createRovingFocusGroupScope } from '@radix-ui/react-roving-focus';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Component: CheckboxGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_GROUP_NAME = 'CheckboxGroup';\n\ntype ScopedProps<P> = P & { __scopeCheckboxGroup?: Scope };\n\nconst [createCheckboxGroupContext, createCheckboxGroupScope] =\n createContextScope(CHECKBOX_GROUP_NAME, [\n createRovingFocusGroupScope,\n createCheckboxScope,\n ]);\n\nconst useRovingFocusGroupScope = createRovingFocusGroupScope();\nconst useCheckboxScope = createCheckboxScope();\n\ninterface CheckboxGroupContextValue {\n name?: string;\n required: boolean;\n disabled: boolean;\n value?: string[];\n onItemCheck: (value: string) => void;\n onItemUncheck: (value: string) => void;\n}\n\nconst [CheckboxGroupProvider, useCheckboxGroupContext] =\n createCheckboxGroupContext<CheckboxGroupContextValue>(CHECKBOX_GROUP_NAME);\n\ntype CheckboxGroupElement = React.ElementRef<typeof Primitive.div>;\n\ninterface CheckboxGroupProps\n extends React.ComponentPropsWithoutRef<typeof Primitive.div> {\n name?: CheckboxGroupContextValue['name'];\n required?: React.ComponentPropsWithoutRef<\n typeof CheckboxPrimitive.Root\n >['required'];\n disabled?: React.ComponentPropsWithoutRef<\n typeof CheckboxPrimitive.Root\n >['disabled'];\n dir?: RovingFocusGroup.RovingFocusGroupProps['dir'];\n orientation?: RovingFocusGroup.RovingFocusGroupProps['orientation'];\n loop?: RovingFocusGroup.RovingFocusGroupProps['loop'];\n defaultValue?: string[];\n value?: CheckboxGroupContextValue['value'];\n onValueChange?: (value: string[]) => void;\n}\n\nconst CheckboxGroup = React.forwardRef<\n CheckboxGroupElement,\n CheckboxGroupProps\n>(\n (\n {\n __scopeCheckboxGroup,\n name,\n defaultValue,\n value: valueProp,\n required = false,\n disabled = false,\n orientation,\n dir,\n loop = true,\n onValueChange,\n ...props\n }: ScopedProps<CheckboxGroupProps>,\n ref,\n ) => {\n const rovingFocusGroupScope =\n useRovingFocusGroupScope(__scopeCheckboxGroup);\n const direction = useDirection(dir);\n const [value = [], setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue,\n onChange: onValueChange,\n });\n\n const handleItemCheck = React.useCallback(\n (itemValue: string) => {\n setValue((prevValue = []) => [...prevValue, itemValue]);\n },\n [setValue],\n );\n\n const handleItemUncheck = React.useCallback(\n (itemValue: string) => {\n setValue((prevValue = []) =>\n prevValue.filter((val) => val !== itemValue),\n );\n },\n [setValue],\n );\n\n return (\n <CheckboxGroupProvider\n scope={__scopeCheckboxGroup}\n name={name}\n required={required}\n disabled={disabled}\n value={value}\n onItemCheck={handleItemCheck}\n onItemUncheck={handleItemUncheck}\n >\n <RovingFocusGroup.Root\n asChild\n {...rovingFocusGroupScope}\n orientation={orientation}\n dir={direction}\n loop={loop}\n >\n {/* eslint-disable-next-line react/jsx-pascal-case -- radix-ui */}\n <Primitive.div\n ref={ref}\n role=\"group\"\n data-disabled={disabled ? '' : undefined}\n dir={direction}\n {...props}\n />\n </RovingFocusGroup.Root>\n </CheckboxGroupProvider>\n );\n },\n);\n\nCheckboxGroup.displayName = CHECKBOX_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Component: CheckboxGroupItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = `${CHECKBOX_GROUP_NAME}Item`;\n\ntype CheckboxGroupItemElement = React.ElementRef<typeof CheckboxPrimitive.Root>;\n\ninterface CheckboxGroupItemProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>,\n 'checked' | 'defaultChecked' | 'onCheckedChange' | 'name'\n > {\n value: string;\n}\n\nconst CheckboxGroupItem = React.forwardRef<\n CheckboxGroupItemElement,\n CheckboxGroupItemProps\n>(\n (\n {\n __scopeCheckboxGroup,\n disabled,\n ...props\n }: ScopedProps<CheckboxGroupItemProps>,\n ref,\n ) => {\n const context = useCheckboxGroupContext(ITEM_NAME, __scopeCheckboxGroup);\n const isDisabled = context.disabled || disabled;\n const rovingFocusGroupScope =\n useRovingFocusGroupScope(__scopeCheckboxGroup);\n const checkboxScope = useCheckboxScope(__scopeCheckboxGroup);\n const checked = context.value?.includes(props.value);\n\n return (\n <RovingFocusGroup.Item\n asChild\n {...rovingFocusGroupScope}\n focusable={!isDisabled}\n active={checked}\n >\n <CheckboxPrimitive.Root\n ref={ref}\n name={context.name}\n disabled={isDisabled}\n required={context.required}\n checked={checked}\n {...checkboxScope}\n {...props}\n onCheckedChange={(checkedState) => {\n if (checkedState) {\n context.onItemCheck(props.value);\n } else {\n context.onItemUncheck(props.value);\n }\n }}\n />\n </RovingFocusGroup.Item>\n );\n },\n);\n\nCheckboxGroupItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Component: CheckboxGroupIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = `${CHECKBOX_GROUP_NAME}Indicator`;\n\ntype CheckboxGroupIndicatorElement = React.ElementRef<\n typeof CheckboxPrimitive.Indicator\n>;\ntype CheckboxGroupIndicatorProps = React.ComponentPropsWithoutRef<\n typeof CheckboxPrimitive.Indicator\n>;\n\nconst CheckboxGroupIndicator = React.forwardRef<\n CheckboxGroupIndicatorElement,\n CheckboxGroupIndicatorProps\n>(\n (\n {\n __scopeCheckboxGroup,\n ...props\n }: ScopedProps<CheckboxGroupIndicatorProps>,\n ref,\n ) => {\n const checkboxScope = useCheckboxScope(__scopeCheckboxGroup);\n return (\n <CheckboxPrimitive.Indicator ref={ref} {...checkboxScope} {...props} />\n );\n },\n);\n\nCheckboxGroupIndicator.displayName = INDICATOR_NAME;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nconst Root = CheckboxGroup;\nconst Item = CheckboxGroupItem;\nconst Indicator = CheckboxGroupIndicator;\n\nexport {\n createCheckboxGroupScope,\n CheckboxGroup,\n CheckboxGroupItem,\n CheckboxGroupIndicator,\n Root,\n Item,\n Indicator,\n type CheckboxGroupProps,\n type CheckboxGroupItemProps,\n type CheckboxGroupIndicatorProps,\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/react/checkbox-group.primitive.tsx"],"names":["React","CheckboxPrimitive","createCheckboxScope","createContextScope","RovingFocusGroup","createRovingFocusGroupScope","useControllableState","useDirection","Primitive","jsx","CHECKBOX_GROUP_NAME","createCheckboxGroupContext","createCheckboxGroupScope","useRovingFocusGroupScope","useCheckboxScope","CheckboxGroupProvider","useCheckboxGroupContext","CheckboxGroup","__scopeCheckboxGroup","name","defaultValue","valueProp","required","disabled","orientation","dir","loop","onValueChange","props","ref","rovingFocusGroupScope","direction","value","setValue","handleItemCheck","itemValue","prevValue","handleItemUncheck","val","ITEM_NAME","CheckboxGroupItem","context","isDisabled","checkboxScope","checked","checkedState","INDICATOR_NAME","CheckboxGroupIndicator","Root","Item","Indicator"],"mappings":"AAAA,UAAYA,MAAW,QACvB,UAAYC,MAAuB,2BACnC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L,KAAML,EAGN,SAAAjB,EAACD,EAAU,IAAV,CACC,IAAKqB,EACL,KAAK,QACL,gBAAeN,EAAW,GAAK,OAC/B,IAAKQ,EACJ,GAAGH,EACN,EACF,EACF,CAEJ,CACF,EAEAX,EAAc,YAAcP,EAM5B,IAAM6B,EAAY,GAAG7B,CAAmB,OAYlC8B,EAA0B,aAI9B,CACE,CACE,qBAAAtB,EACA,SAAAK,EACA,GAAGK,CACL,EACAC,IACG,CACH,IAAMY,EAAUzB,EAAwBuB,EAAWrB,CAAoB,EACjEwB,EAAaD,EAAQ,UAAYlB,EACjCO,EACJjB,EAAyBK,CAAoB,EACzCyB,EAAgB7B,EAAiBI,CAAoB,EACrD0B,EAAUH,EAAQ,OAAO,SAASb,EAAM,KAAK,EAEnD,OACEnB,EAAkB,OAAjB,CACC,QAAO,GACN,GAAGqB,EACJ,UAAW,CAACY,EACZ,OAAQE,EAER,SAAAnC,EAAmB,OAAlB,CACC,IAAKoB,EACL,KAAMY,EAAQ,KACd,SAAUC,EACV,SAAUD,EAAQ,SAClB,QAASG,EACR,GAAGD,EACH,GAAGf,EACJ,gBAAkBiB,GAAiB,CAC7BA,EACFJ,EAAQ,YAAYb,EAAM,KAAK,EAE/Ba,EAAQ,cAAcb,EAAM,KAAK,CAErC,EACF,EACF,CAEJ,CACF,EAEAY,EAAkB,YAAcD,EAMhC,IAAMO,EAAiB,GAAGpC,CAAmB,YASvCqC,EAA+B,aAInC,CACE,CACE,qBAAA7B,EACA,GAAGU,CACL,EACAC,IACG,CACH,IAAMc,EAAgB7B,EAAiBI,CAAoB,EAE3D,OACET,EAAmB,YAAlB,CAA4B,IAAKoB,EAAM,GAAGc,EAAgB,GAAGf,EAAO,CAEzE,CACF,EAEAmB,EAAuB,YAAcD,EAMrC,IAAME,EAAO/B,EACPgC,EAAOT,EACPU,EAAYH","sourcesContent":["import * as React from 'react';\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { createCheckboxScope } from '@radix-ui/react-checkbox';\nimport { createContextScope, type Scope } from '@radix-ui/react-context';\nimport * as RovingFocusGroup from '@radix-ui/react-roving-focus';\nimport { createRovingFocusGroupScope } from '@radix-ui/react-roving-focus';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Component: CheckboxGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_GROUP_NAME = 'CheckboxGroup';\n\ntype ScopedProps<P> = P & { __scopeCheckboxGroup?: Scope };\n\nconst [createCheckboxGroupContext, createCheckboxGroupScope] =\n createContextScope(CHECKBOX_GROUP_NAME, [\n createRovingFocusGroupScope,\n createCheckboxScope,\n ]);\n\nconst useRovingFocusGroupScope = createRovingFocusGroupScope();\nconst useCheckboxScope = createCheckboxScope();\n\ninterface CheckboxGroupContextValue {\n name?: string;\n required: boolean;\n disabled: boolean;\n value?: string[];\n onItemCheck: (value: string) => void;\n onItemUncheck: (value: string) => void;\n}\n\nconst [CheckboxGroupProvider, useCheckboxGroupContext] =\n createCheckboxGroupContext<CheckboxGroupContextValue>(CHECKBOX_GROUP_NAME);\n\ntype CheckboxGroupElement = React.ElementRef<typeof Primitive.div>;\n\ninterface CheckboxGroupProps\n extends React.ComponentPropsWithoutRef<typeof Primitive.div> {\n name?: CheckboxGroupContextValue['name'];\n required?: React.ComponentPropsWithoutRef<\n typeof CheckboxPrimitive.Root\n >['required'];\n disabled?: React.ComponentPropsWithoutRef<\n typeof CheckboxPrimitive.Root\n >['disabled'];\n dir?: RovingFocusGroup.RovingFocusGroupProps['dir'];\n orientation?: RovingFocusGroup.RovingFocusGroupProps['orientation'];\n loop?: RovingFocusGroup.RovingFocusGroupProps['loop'];\n defaultValue?: string[];\n value?: CheckboxGroupContextValue['value'];\n onValueChange?: (value: string[]) => void;\n}\n\nconst CheckboxGroup = React.forwardRef<\n CheckboxGroupElement,\n CheckboxGroupProps\n>(\n (\n {\n __scopeCheckboxGroup,\n name,\n defaultValue,\n value: valueProp,\n required = false,\n disabled = false,\n orientation,\n dir,\n loop = true,\n onValueChange,\n ...props\n }: ScopedProps<CheckboxGroupProps>,\n ref,\n ) => {\n const rovingFocusGroupScope =\n useRovingFocusGroupScope(__scopeCheckboxGroup);\n const direction = useDirection(dir);\n const [value = [], setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue,\n onChange: onValueChange,\n });\n\n const handleItemCheck = React.useCallback(\n (itemValue: string) => {\n setValue((prevValue = []) => [...prevValue, itemValue]);\n },\n [setValue],\n );\n\n const handleItemUncheck = React.useCallback(\n (itemValue: string) => {\n setValue((prevValue = []) =>\n prevValue.filter((val) => val !== itemValue),\n );\n },\n [setValue],\n );\n\n return (\n <CheckboxGroupProvider\n scope={__scopeCheckboxGroup}\n name={name}\n required={required}\n disabled={disabled}\n value={value}\n onItemCheck={handleItemCheck}\n onItemUncheck={handleItemUncheck}\n >\n <RovingFocusGroup.Root\n asChild\n {...rovingFocusGroupScope}\n orientation={orientation}\n dir={direction}\n loop={loop}\n >\n {/* eslint-disable-next-line react/jsx-pascal-case -- radix-ui */}\n <Primitive.div\n ref={ref}\n role=\"group\"\n data-disabled={disabled ? '' : undefined}\n dir={direction}\n {...props}\n />\n </RovingFocusGroup.Root>\n </CheckboxGroupProvider>\n );\n },\n);\n\nCheckboxGroup.displayName = CHECKBOX_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Component: CheckboxGroupItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = `${CHECKBOX_GROUP_NAME}Item`;\n\ntype CheckboxGroupItemElement = React.ElementRef<typeof CheckboxPrimitive.Root>;\n\ninterface CheckboxGroupItemProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>,\n 'checked' | 'defaultChecked' | 'onCheckedChange' | 'name'\n > {\n value: string;\n}\n\nconst CheckboxGroupItem = React.forwardRef<\n CheckboxGroupItemElement,\n CheckboxGroupItemProps\n>(\n (\n {\n __scopeCheckboxGroup,\n disabled,\n ...props\n }: ScopedProps<CheckboxGroupItemProps>,\n ref,\n ) => {\n const context = useCheckboxGroupContext(ITEM_NAME, __scopeCheckboxGroup);\n const isDisabled = context.disabled || disabled;\n const rovingFocusGroupScope =\n useRovingFocusGroupScope(__scopeCheckboxGroup);\n const checkboxScope = useCheckboxScope(__scopeCheckboxGroup);\n const checked = context.value?.includes(props.value);\n\n return (\n <RovingFocusGroup.Item\n asChild\n {...rovingFocusGroupScope}\n focusable={!isDisabled}\n active={checked}\n >\n <CheckboxPrimitive.Root\n ref={ref}\n name={context.name}\n disabled={isDisabled}\n required={context.required}\n checked={checked}\n {...checkboxScope}\n {...props}\n onCheckedChange={(checkedState) => {\n if (checkedState) {\n context.onItemCheck(props.value);\n } else {\n context.onItemUncheck(props.value);\n }\n }}\n />\n </RovingFocusGroup.Item>\n );\n },\n);\n\nCheckboxGroupItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Component: CheckboxGroupIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = `${CHECKBOX_GROUP_NAME}Indicator`;\n\ntype CheckboxGroupIndicatorElement = React.ElementRef<\n typeof CheckboxPrimitive.Indicator\n>;\ntype CheckboxGroupIndicatorProps = React.ComponentPropsWithoutRef<\n typeof CheckboxPrimitive.Indicator\n>;\n\nconst CheckboxGroupIndicator = React.forwardRef<\n CheckboxGroupIndicatorElement,\n CheckboxGroupIndicatorProps\n>(\n (\n {\n __scopeCheckboxGroup,\n ...props\n }: ScopedProps<CheckboxGroupIndicatorProps>,\n ref,\n ) => {\n const checkboxScope = useCheckboxScope(__scopeCheckboxGroup);\n\n return (\n <CheckboxPrimitive.Indicator ref={ref} {...checkboxScope} {...props} />\n );\n },\n);\n\nCheckboxGroupIndicator.displayName = INDICATOR_NAME;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nconst Root = CheckboxGroup;\nconst Item = CheckboxGroupItem;\nconst Indicator = CheckboxGroupIndicator;\n\nexport {\n createCheckboxGroupScope,\n CheckboxGroup,\n CheckboxGroupItem,\n CheckboxGroupIndicator,\n Root,\n Item,\n Indicator,\n type CheckboxGroupProps,\n type CheckboxGroupItemProps,\n type CheckboxGroupIndicatorProps,\n};\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as p}from"./chunk-LEUB3C3L.mjs";import*as a from"react";import*as e from"@radix-ui/react-dropdown-menu";import{CheckIcon as u,ChevronRightIcon as m,DotFilledIcon as c}from"@radix-ui/react-icons";import{jsx as r,jsxs as s}from"react/jsx-runtime";var g=e.Root,C=e.Trigger,I=e.Group,h=e.Sub,S=e.RadioGroup,l=a.forwardRef(({children:o,className:t,inset:n,...i},d)=>s(e.SubTrigger,{ref:d,className:p("focus:bg-accent data-[state=open]:bg-accent flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none",n&&"pl-8",t),...i,children:[o,r(m,{className:"ml-auto size-4"})]}));l.displayName=e.SubTrigger.displayName;var w=a.forwardRef(({className:o,...t},n)=>r(e.Portal,{children:r(e.SubContent,{ref:n,className:p("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-32 rounded-md border p-1 shadow-md",o),...t})}));w.displayName=e.SubContent.displayName;var M=a.forwardRef(({className:o,sideOffset:t=6,...n},i)=>r(e.Portal,{children:r(e.Content,{ref:i,sideOffset:t,className:p("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-32 rounded-md border p-1 shadow-md",o),...n})}));M.displayName=e.Content.displayName;var f=a.forwardRef(({className:o,inset:t,...n},i)=>r(e.Item,{ref:i,className:p("focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",t&&"pl-8",o),...n}));f.displayName=e.Item.displayName;var D=a.forwardRef(({children:o,className:t,checked:n,...i},d)=>s(e.CheckboxItem,{ref:d,className:p("focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",t),checked:n,...i,children:[r("span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:r(e.ItemIndicator,{children:r(u,{className:"size-4"})})}),o]}));D.displayName=e.CheckboxItem.displayName;var P=a.forwardRef(({children:o,className:t,...n},i)=>s(e.RadioItem,{ref:i,className:p("focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",t),...n,children:[r("span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:r(e.ItemIndicator,{children:r(c,{className:"size-4 fill-current"})})}),o]}));P.displayName=e.RadioItem.displayName;var y=a.forwardRef(({className:o,inset:t,...n},i)=>r(e.Label,{ref:i,className:p("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",o),...n}));y.displayName=e.Label.displayName;var R=a.forwardRef(({className:o,...t},n)=>r(e.Separator,{ref:n,className:p("bg-muted -mx-1 my-1 h-px",o),...t}));R.displayName=e.Separator.displayName;function x({className:o,...t}){return r("span",{className:p("ml-auto text-xs tracking-widest opacity-60",o),...t})}export{g as a,C as b,I as c,h as d,S as e,l as f,w as g,M as h,f as i,D as j,P as k,y as l,R as m,x as n};
|
|
2
|
+
//# sourceMappingURL=chunk-XHNT6PVI.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/dropdown-menu.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport {\n CheckIcon,\n ChevronRightIcon,\n DotFilledIcon,\n} from '@radix-ui/react-icons';\nimport { cn } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenu\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuProps = React.ComponentProps<\n typeof DropdownMenuPrimitive.Root\n>;\nconst DropdownMenu = DropdownMenuPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuTrigger\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuTriggerProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Trigger\n>;\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuGroup\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuGroupProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Group\n>;\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSub\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuSubProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Sub\n>;\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuRadioGroupProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.RadioGroup\n>;\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuSubTriggerElement = React.ElementRef<\n typeof DropdownMenuPrimitive.SubTrigger\n>;\n\ninterface DropdownMenuSubTriggerProps\n extends React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.SubTrigger\n > {\n inset?: boolean;\n}\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n DropdownMenuSubTriggerElement,\n DropdownMenuSubTriggerProps\n>(({ children, className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'focus:bg-accent data-[state=open]:bg-accent flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\n\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubContent\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuSubContentProps =\n DropdownMenuPrimitive.DropdownMenuSubContentProps;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n DropdownMenuSubContentProps\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-32 rounded-md border p-1 shadow-md',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\n\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuContent\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuContentElement = React.ElementRef<\n typeof DropdownMenuPrimitive.Content\n>;\ntype DropdownMenuContentProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Content\n>;\n\nconst DropdownMenuContent = React.forwardRef<\n DropdownMenuContentElement,\n DropdownMenuContentProps\n>(({ className, sideOffset = 6, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-32 rounded-md border p-1 shadow-md',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\n\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuItem\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuItemElement = React.ElementRef<\n typeof DropdownMenuPrimitive.Item\n>;\n\ninterface DropdownMenuItemProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> {\n inset?: boolean;\n}\n\nconst DropdownMenuItem = React.forwardRef<\n DropdownMenuItemElement,\n DropdownMenuItemProps\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n));\n\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuCheckboxItem\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuCheckboxItemElement = React.ElementRef<\n typeof DropdownMenuPrimitive.CheckboxItem\n>;\ntype DropdownMenuCheckboxItemProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.CheckboxItem\n>;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n DropdownMenuCheckboxItemElement,\n DropdownMenuCheckboxItemProps\n>(({ children, className, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\n\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuRadioItem\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuRadioItemElement = React.ElementRef<\n typeof DropdownMenuPrimitive.RadioItem\n>;\ntype DropdownMenuRadioItemProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.RadioItem\n>;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n DropdownMenuRadioItemElement,\n DropdownMenuRadioItemProps\n>(({ children, className, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <DotFilledIcon className=\"size-4 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\n\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuLabel\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuLabelElement = React.ElementRef<\n typeof DropdownMenuPrimitive.Label\n>;\n\ninterface DropdownMenuLabelProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> {\n inset?: boolean;\n}\n\nconst DropdownMenuLabel = React.forwardRef<\n DropdownMenuLabelElement,\n DropdownMenuLabelProps\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n 'px-2 py-1.5 text-sm font-semibold',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n));\n\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSeparator\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuSeparatorElement = React.ElementRef<\n typeof DropdownMenuPrimitive.Separator\n>;\ntype DropdownMenuSeparatorProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Separator\n>;\n\nconst DropdownMenuSeparator = React.forwardRef<\n DropdownMenuSeparatorElement,\n DropdownMenuSeparatorProps\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn('bg-muted -mx-1 my-1 h-px', className)}\n {...props}\n />\n));\n\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuShortcut\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuShortcutProps = React.HTMLAttributes<HTMLSpanElement>;\n\nfunction DropdownMenuShortcut({\n className,\n ...props\n}: DropdownMenuShortcutProps): React.JSX.Element {\n return (\n <span\n className={cn('ml-auto text-xs tracking-widest opacity-60', className)}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n type DropdownMenuProps,\n type DropdownMenuTriggerProps,\n type DropdownMenuContentProps,\n type DropdownMenuItemProps,\n type DropdownMenuCheckboxItemProps,\n type DropdownMenuRadioItemProps,\n type DropdownMenuLabelProps,\n type DropdownMenuSeparatorProps,\n type DropdownMenuShortcutProps,\n type DropdownMenuGroupProps,\n type DropdownMenuSubProps,\n type DropdownMenuSubContentProps,\n type DropdownMenuSubTriggerProps,\n type DropdownMenuRadioGroupProps,\n};\n"],"mappings":"yCAEA,UAAYA,MAAW,QACvB,UAAYC,MAA2B,gCACvC,OACE,aAAAC,EACA,oBAAAC,EACA,iBAAAC,MACK,wBAmEL,OAUE,OAAAC,EAVF,QAAAC,MAAA,oBAzDF,IAAMC,EAAqC,OASrCC,EAA4C,UAS5CC,EAA0C,QAS1CC,EAAwC,MASxCC,EAA+C,aAiB/CC,EAA+B,aAGnC,CAAC,CAAE,SAAAC,EAAU,UAAAC,EAAW,MAAAC,EAAO,GAAGC,CAAM,EAAGC,IAC3CX,EAAuB,aAAtB,CACC,IAAKW,EACL,UAAWC,EACT,6IACAH,GAAS,OACTD,CACF,EACC,GAAGE,EAEH,UAAAH,EACDR,EAACc,EAAA,CAAiB,UAAU,iBAAiB,GAC/C,CACD,EAEDP,EAAuB,YACC,aAAW,YASnC,IAAMQ,EAA+B,aAGnC,CAAC,CAAE,UAAAN,EAAW,GAAGE,CAAM,EAAGC,IAC1BZ,EAAuB,SAAtB,CACC,SAAAA,EAAuB,aAAtB,CACC,IAAKY,EACL,UAAWC,EACT,gtBACAJ,CACF,EACC,GAAGE,EACN,EACF,CACD,EAEDI,EAAuB,YACC,aAAW,YAanC,IAAMC,EAA4B,aAGhC,CAAC,CAAE,UAAAP,EAAW,WAAAQ,EAAa,EAAG,GAAGN,CAAM,EAAGC,IAC1CZ,EAAuB,SAAtB,CACC,SAAAA,EAAuB,UAAtB,CACC,IAAKY,EACL,WAAYK,EACZ,UAAWJ,EACT,gtBACAJ,CACF,EACC,GAAGE,EACN,EACF,CACD,EAEDK,EAAoB,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G,2BAA4BJ,CAAS,EAClD,GAAGE,EACN,CACD,EAEDc,EAAsB,YAAoC,YAAU,YAQpE,SAASC,EAAqB,CAC5B,UAAAjB,EACA,GAAGE,CACL,EAAiD,CAC/C,OACEX,EAAC,QACC,UAAWa,EAAG,6CAA8CJ,CAAS,EACpE,GAAGE,EACN,CAEJ","names":["React","DropdownMenuPrimitive","CheckIcon","ChevronRightIcon","DotFilledIcon","jsx","jsxs","DropdownMenu","DropdownMenuTrigger","DropdownMenuGroup","DropdownMenuSub","DropdownMenuRadioGroup","DropdownMenuSubTrigger","children","className","inset","props","ref","cn","ChevronRightIcon","DropdownMenuSubContent","DropdownMenuContent","sideOffset","DropdownMenuItem","DropdownMenuCheckboxItem","checked","CheckIcon","DropdownMenuRadioItem","DotFilledIcon","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut"]}
|
|
1
|
+
{"version":3,"sources":["../src/react/dropdown-menu.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport {\n CheckIcon,\n ChevronRightIcon,\n DotFilledIcon,\n} from '@radix-ui/react-icons';\nimport { cn } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenu\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuProps = React.ComponentProps<\n typeof DropdownMenuPrimitive.Root\n>;\nconst DropdownMenu = DropdownMenuPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuTrigger\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuTriggerProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Trigger\n>;\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuGroup\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuGroupProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Group\n>;\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSub\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuSubProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Sub\n>;\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuRadioGroupProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.RadioGroup\n>;\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuSubTriggerElement = React.ElementRef<\n typeof DropdownMenuPrimitive.SubTrigger\n>;\n\ninterface DropdownMenuSubTriggerProps\n extends React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.SubTrigger\n > {\n inset?: boolean;\n}\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n DropdownMenuSubTriggerElement,\n DropdownMenuSubTriggerProps\n>(({ children, className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'focus:bg-accent data-[state=open]:bg-accent flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\n\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubContent\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuSubContentProps =\n DropdownMenuPrimitive.DropdownMenuSubContentProps;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n DropdownMenuSubContentProps\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-32 rounded-md border p-1 shadow-md',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\n\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuContent\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuContentElement = React.ElementRef<\n typeof DropdownMenuPrimitive.Content\n>;\ntype DropdownMenuContentProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Content\n>;\n\nconst DropdownMenuContent = React.forwardRef<\n DropdownMenuContentElement,\n DropdownMenuContentProps\n>(({ className, sideOffset = 6, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-32 rounded-md border p-1 shadow-md',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\n\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuItem\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuItemElement = React.ElementRef<\n typeof DropdownMenuPrimitive.Item\n>;\n\ninterface DropdownMenuItemProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> {\n inset?: boolean;\n}\n\nconst DropdownMenuItem = React.forwardRef<\n DropdownMenuItemElement,\n DropdownMenuItemProps\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n));\n\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuCheckboxItem\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuCheckboxItemElement = React.ElementRef<\n typeof DropdownMenuPrimitive.CheckboxItem\n>;\ntype DropdownMenuCheckboxItemProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.CheckboxItem\n>;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n DropdownMenuCheckboxItemElement,\n DropdownMenuCheckboxItemProps\n>(({ children, className, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\n\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuRadioItem\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuRadioItemElement = React.ElementRef<\n typeof DropdownMenuPrimitive.RadioItem\n>;\ntype DropdownMenuRadioItemProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.RadioItem\n>;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n DropdownMenuRadioItemElement,\n DropdownMenuRadioItemProps\n>(({ children, className, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <DotFilledIcon className=\"size-4 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\n\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuLabel\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuLabelElement = React.ElementRef<\n typeof DropdownMenuPrimitive.Label\n>;\n\ninterface DropdownMenuLabelProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> {\n inset?: boolean;\n}\n\nconst DropdownMenuLabel = React.forwardRef<\n DropdownMenuLabelElement,\n DropdownMenuLabelProps\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n 'px-2 py-1.5 text-sm font-semibold',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n));\n\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSeparator\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuSeparatorElement = React.ElementRef<\n typeof DropdownMenuPrimitive.Separator\n>;\ntype DropdownMenuSeparatorProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Separator\n>;\n\nconst DropdownMenuSeparator = React.forwardRef<\n DropdownMenuSeparatorElement,\n DropdownMenuSeparatorProps\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn('bg-muted -mx-1 my-1 h-px', className)}\n {...props}\n />\n));\n\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuShortcut\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuShortcutProps = React.HTMLAttributes<HTMLSpanElement>;\n\nfunction DropdownMenuShortcut({\n className,\n ...props\n}: DropdownMenuShortcutProps): React.JSX.Element {\n return (\n <span\n className={cn('ml-auto text-xs tracking-widest opacity-60', className)}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n type DropdownMenuProps,\n type DropdownMenuTriggerProps,\n type DropdownMenuContentProps,\n type DropdownMenuItemProps,\n type DropdownMenuCheckboxItemProps,\n type DropdownMenuRadioItemProps,\n type DropdownMenuLabelProps,\n type DropdownMenuSeparatorProps,\n type DropdownMenuShortcutProps,\n type DropdownMenuGroupProps,\n type DropdownMenuSubProps,\n type DropdownMenuSubContentProps,\n type DropdownMenuSubTriggerProps,\n type DropdownMenuRadioGroupProps,\n};\n"],"mappings":"yCAEA,UAAYA,MAAW,QACvB,UAAYC,MAA2B,gCACvC,OACE,aAAAC,EACA,oBAAAC,EACA,iBAAAC,MACK,wBAmEL,OAUE,OAAAC,EAVF,QAAAC,MAAA,oBAzDF,IAAMC,EAAqC,OASrCC,EAA4C,UAS5CC,EAA0C,QAS1CC,EAAwC,MASxCC,EAA+C,aAiB/CC,EAA+B,aAGnC,CAAC,CAAE,SAAAC,EAAU,UAAAC,EAAW,MAAAC,EAAO,GAAGC,CAAM,EAAGC,IAC3CX,EAAuB,aAAtB,CACC,IAAKW,EACL,UAAWC,EACT,6IACAH,GAAS,OACTD,CACF,EACC,GAAGE,EAEH,UAAAH,EACDR,EAACc,EAAA,CAAiB,UAAU,iBAAiB,GAC/C,CACD,EAEDP,EAAuB,YACC,aAAW,YASnC,IAAMQ,EAA+B,aAGnC,CAAC,CAAE,UAAAN,EAAW,GAAGE,CAAM,EAAGC,IAC1BZ,EAAuB,SAAtB,CACC,SAAAA,EAAuB,aAAtB,CACC,IAAKY,EACL,UAAWC,EACT,gtBACAJ,CACF,EACC,GAAGE,EACN,EACF,CACD,EAEDI,EAAuB,YACC,aAAW,YAanC,IAAMC,EAA4B,aAGhC,CAAC,CAAE,UAAAP,EAAW,WAAAQ,EAAa,EAAG,GAAGN,CAAM,EAAGC,IAC1CZ,EAAuB,SAAtB,CACC,SAAAA,EAAuB,UAAtB,CACC,IAAKY,EACL,WAAYK,EACZ,UAAWJ,EACT,gtBACAJ,CACF,EACC,GAAGE,EACN,EACF,CACD,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ACL,UAAWC,EAAG,2BAA4BJ,CAAS,EAClD,GAAGE,EACN,CACD,EAEDc,EAAsB,YAAoC,YAAU,YAQpE,SAASC,EAAqB,CAC5B,UAAAjB,EACA,GAAGE,CACL,EAAiD,CAC/C,OACEX,EAAC,QACC,UAAWa,EAAG,6CAA8CJ,CAAS,EACpE,GAAGE,EACN,CAEJ","names":["React","DropdownMenuPrimitive","CheckIcon","ChevronRightIcon","DotFilledIcon","jsx","jsxs","DropdownMenu","DropdownMenuTrigger","DropdownMenuGroup","DropdownMenuSub","DropdownMenuRadioGroup","DropdownMenuSubTrigger","children","className","inset","props","ref","cn","ChevronRightIcon","DropdownMenuSubContent","DropdownMenuContent","sideOffset","DropdownMenuItem","DropdownMenuCheckboxItem","checked","CheckIcon","DropdownMenuRadioItem","DotFilledIcon","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut"]}
|