@epam/ai-dial-ui-kit 0.15.0-dev.4 → 0.15.0-dev.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +191 -0
- package/dist/CHANGELOG.md +75 -0
- package/dist/DateCellRenderer-ChqbDlQ2.cjs +1 -0
- package/dist/{DateCellRenderer-BVM-Q8yx.cjs → DateCellRenderer-Cl_mNbi1.cjs} +31 -31
- package/dist/IconButton-DHOFapLo.cjs +1 -0
- package/dist/JsonEditor-CpSpVa0v.cjs +1 -0
- package/dist/{MarkdownEditor-jQ8nDJfx.cjs → MarkdownEditor-CPzMv3lE.cjs} +1 -1
- package/dist/{MarkdownEditor-DHn2pYOJ.cjs → MarkdownEditor-NYMcKLJy.cjs} +1 -1
- package/dist/MarkdownEditorContainer-DVPRplYf.cjs +1 -0
- package/dist/{Switch-CUKClcEz.cjs → Switch-DE6MrcqJ.cjs} +1 -1
- package/dist/components/Button/constants.js +9 -8
- package/dist/components/Dropdown/Dropdown.js +70 -65
- package/dist/components/Dropdown/DropdownSubMenuItem.js +63 -55
- package/dist/components/Dropdown/constants.js +16 -14
- package/dist/components/DropdownIcon/DropdownIcon.js +43 -32
- package/dist/components/FileManager/FileManager.js +373 -372
- package/dist/components/FileManager/FileManagerProvider.js +266 -264
- package/dist/components/FileManager/hooks/use-grid-context-menu.js +59 -59
- package/dist/components/MarkdownEditor/MarkdownEditorContainer.js +18 -16
- package/dist/components/New/Accordion/Accordion.js +87 -71
- package/dist/components/New/AutocompleteTagInput/AutocompleteTagInput.js +206 -0
- package/dist/components/New/AutocompleteTagInput/utils.js +11 -0
- package/dist/components/New/Avatar/Avatar.js +70 -0
- package/dist/components/New/Badge/Badge.js +45 -0
- package/dist/components/New/BottomSheet/BottomSheet.js +128 -0
- package/dist/components/New/Breadcrumbs/Breadcrumbs.js +159 -0
- package/dist/components/New/Breadcrumbs/constants.js +41 -0
- package/dist/components/New/Button/Button.js +32 -32
- package/dist/components/New/Button/ButtonWrappers.js +93 -37
- package/dist/components/New/Button/constants.js +3 -0
- package/dist/components/New/Button/utils.js +18 -8
- package/dist/components/New/ButtonDropdown/ButtonDropdown.js +26 -16
- package/dist/components/New/Calendar/Calendar.js +301 -265
- package/dist/components/New/Calendar/constants.js +5 -5
- package/dist/components/New/CaptionText/CaptionText.js +18 -15
- package/dist/components/New/CardShell/CardShell.js +5 -3
- package/dist/components/New/Checkbox/Checkbox.js +67 -56
- package/dist/components/New/Checkbox/CheckboxBox.js +5 -3
- package/dist/components/New/CloseButton/CloseButton.js +18 -16
- package/dist/components/New/CollapsibleSidebar/CollapsibleSidebar.js +39 -34
- package/dist/components/New/ConfirmationPopup/ConfirmationPopup.js +38 -37
- package/dist/components/New/ConfirmationPopup/constants.js +8 -11
- package/dist/components/New/Dropdown/Dropdown.js +112 -105
- package/dist/components/New/Dropdown/DropdownSubMenuItem.js +17 -17
- package/dist/components/New/Dropdown/constants.js +22 -17
- package/dist/components/New/EllipsisTooltip/EllipsisTooltip.js +20 -18
- package/dist/components/New/EntityIdentity/EntityIdentity.js +135 -0
- package/dist/components/New/FileDropzone/FileDropzone.js +27 -25
- package/dist/components/New/FileIcon/FileIcon.js +55 -0
- package/dist/components/New/FileIcon/constants.js +134 -0
- package/dist/components/New/FileIcon/icons/FileGlyph.js +150 -0
- package/dist/components/New/FileIcon/icons/FolderGlyph.js +50 -0
- package/dist/components/New/FileName/FileName.js +78 -0
- package/dist/components/New/FilterChips/FilterChips.js +43 -0
- package/dist/components/New/FilterChips/constants.js +5 -0
- package/dist/components/New/FolderName/FolderName.js +16 -0
- package/dist/components/New/FolderPath/FolderPath.js +29 -28
- package/dist/components/New/Highlight/Highlight.js +23 -30
- package/dist/components/New/IconButton/IconButton.js +30 -28
- package/dist/components/New/InfoButton/InfoButton.js +13 -11
- package/dist/components/New/InlineSelect/InlineSelect.js +74 -56
- package/dist/components/New/InteractiveTooltip/InteractiveTooltip.js +41 -39
- package/dist/components/New/InteractiveTooltip/constants.js +2 -2
- package/dist/components/New/Label/Label.js +13 -8
- package/dist/components/New/MenuItem/MenuItem.js +29 -27
- package/dist/components/New/MenuItem/constants.js +9 -8
- package/dist/components/New/NoDataContent/NoDataContent.js +21 -19
- package/dist/components/New/Notification/Notification.js +33 -29
- package/dist/components/New/NumberInput/NumberInput.js +42 -33
- package/dist/components/New/PasswordInput/PasswordInput.js +41 -35
- package/dist/components/New/Popup/Popup.js +46 -44
- package/dist/components/New/Popup/constants.js +3 -3
- package/dist/components/New/Radio/Radio.js +75 -64
- package/dist/components/New/RadioGroup/RadioGroup.js +76 -65
- package/dist/components/New/RadioGroupPopupField/RadioGroupPopupField.js +117 -106
- package/dist/components/New/ResizableContainer/ResizableContainer.js +42 -40
- package/dist/components/New/Search/Search.js +29 -27
- package/dist/components/New/SegmentedControl/SegmentedControl.js +29 -23
- package/dist/components/New/Select/CollapsedSelectTags.js +127 -0
- package/dist/components/New/Select/MultiSelectTags.js +18 -15
- package/dist/components/New/Select/Select.js +219 -197
- package/dist/components/New/Select/constants.js +23 -20
- package/dist/components/New/SharedEntityIndicator/SharedEntityIndicator.js +34 -0
- package/dist/components/New/SideDrawer/SideDrawer.js +148 -0
- package/dist/components/New/Switch/Switch.js +69 -58
- package/dist/components/New/Tabs/Tabs.js +125 -61
- package/dist/components/New/Tag/Tag.js +42 -40
- package/dist/components/New/TagInput/TagInput.js +48 -44
- package/dist/components/New/ToggleIconButton/ToggleIconButton.js +26 -24
- package/dist/components/New/Tooltip/TooltipContent.js +11 -9
- package/dist/components/New/Tooltip/constants.js +1 -1
- package/dist/components/New/TransferQueue/TransferQueue.js +124 -0
- package/dist/components/New/TransferQueue/TransferQueueHeader.js +71 -0
- package/dist/components/New/TransferQueue/TransferQueueRow.js +119 -0
- package/dist/components/New/TransferQueue/constants.js +24 -0
- package/dist/components/New/constants/overlay.js +17 -9
- package/dist/components/Popup/constants.js +8 -8
- package/dist/components/ProgressBar/ProgressBar.js +45 -33
- package/dist/components/SchemaRenderer/components/SchemaAdditionalPropertiesEditor.js +46 -31
- package/dist/components/SchemaRenderer/components/SchemaField.js +19 -19
- package/dist/components/SchemaRenderer/components/SchemaFieldContent.js +18 -18
- package/dist/components/SchemaRenderer/components/SchemaKeyValueEditor.js +223 -135
- package/dist/components/SchemaRenderer/types.js +19 -8
- package/dist/components/SchemaRenderer/utils.js +122 -95
- package/dist/components/Skeleton/Skeleton.js +25 -19
- package/dist/components/Spinner/Spinner.js +7 -5
- package/dist/components/Tooltip/TooltipContent.js +11 -11
- package/dist/components-manifest.json +1653 -71
- package/dist/constants/public-class-names.js +210 -0
- package/dist/dial-ui-kit.cjs +2 -2
- package/dist/dial-ui-kit.js +346 -299
- package/dist/editor-Bc9xzKuR.cjs +1 -0
- package/dist/editors.cjs +1 -1
- package/dist/file-manager.cjs +1 -1
- package/dist/grid.cjs +1 -1
- package/dist/index.css +2 -2
- package/dist/lazy-Cy9WobJf.cjs +1 -0
- package/dist/merge-classes-BEJXjzkx.cjs +1 -0
- package/dist/migration-guides/0.15.0/legacy-theme-variable-fallbacks-removal.md +69 -0
- package/dist/migration-guides/README.md +1 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +419 -399
- package/dist/src/components/FileManager/FileManager.d.ts +2 -0
- package/dist/src/components/FileManager/FileManagerContext.d.ts +1 -0
- package/dist/src/components/FileManager/hooks/use-grid-context-menu.d.ts +2 -1
- package/dist/src/components/New/Accordion/Accordion.d.ts +6 -1
- package/dist/src/components/New/AutocompleteTagInput/AutocompleteTagInput.d.ts +97 -0
- package/dist/src/components/New/AutocompleteTagInput/utils.d.ts +17 -0
- package/dist/src/components/New/AutocompleteTagInput/utils.spec.d.ts +1 -0
- package/dist/src/components/New/Avatar/Avatar.d.ts +55 -0
- package/dist/src/components/New/Badge/Badge.d.ts +47 -0
- package/dist/src/components/New/BottomSheet/BottomSheet.d.ts +84 -0
- package/dist/src/components/New/Breadcrumbs/Breadcrumbs.d.ts +94 -0
- package/dist/src/components/New/Breadcrumbs/constants.d.ts +60 -0
- package/dist/src/components/New/Button/Button.d.ts +4 -1
- package/dist/src/components/New/Button/ButtonWrappers.d.ts +20 -0
- package/dist/src/components/New/Button/utils.d.ts +15 -0
- package/dist/src/components/New/ButtonDropdown/ButtonDropdown.d.ts +4 -0
- package/dist/src/components/New/Calendar/Calendar.d.ts +7 -1
- package/dist/src/components/New/Calendar/constants.d.ts +1 -1
- package/dist/src/components/New/ConfirmationPopup/constants.d.ts +0 -1
- package/dist/src/components/New/Dropdown/Dropdown.d.ts +9 -1
- package/dist/src/components/New/Dropdown/constants.d.ts +3 -0
- package/dist/src/components/New/EntityIdentity/EntityIdentity.d.ts +85 -0
- package/dist/src/components/New/FileIcon/FileIcon.d.ts +61 -0
- package/dist/src/components/New/FileIcon/constants.d.ts +16 -0
- package/dist/src/components/New/FileIcon/icons/FileGlyph.d.ts +18 -0
- package/dist/src/components/New/FileIcon/icons/FolderGlyph.d.ts +17 -0
- package/dist/src/components/New/FileName/FileName.d.ts +79 -0
- package/dist/src/components/New/FilterChips/FilterChips.d.ts +69 -0
- package/dist/src/components/New/FilterChips/constants.d.ts +13 -0
- package/dist/src/components/New/FolderName/FolderName.d.ts +37 -0
- package/dist/src/components/New/InlineSelect/InlineSelect.d.ts +16 -1
- package/dist/src/components/New/InteractiveTooltip/constants.d.ts +5 -4
- package/dist/src/components/New/Notification/Notification.d.ts +18 -0
- package/dist/src/components/New/Popup/constants.d.ts +1 -1
- package/dist/src/components/New/Select/CollapsedSelectTags.d.ts +22 -0
- package/dist/src/components/New/Select/MultiSelectTags.d.ts +5 -0
- package/dist/src/components/New/Select/Select.d.ts +9 -0
- package/dist/src/components/New/Select/constants.d.ts +3 -2
- package/dist/src/components/New/SharedEntityIndicator/SharedEntityIndicator.d.ts +35 -0
- package/dist/src/components/New/SideDrawer/SideDrawer.d.ts +100 -0
- package/dist/src/components/New/Tabs/Tabs.d.ts +54 -6
- package/dist/src/components/New/Tooltip/constants.d.ts +5 -3
- package/dist/src/components/New/TransferQueue/TransferQueue.d.ts +139 -0
- package/dist/src/components/New/TransferQueue/TransferQueueHeader.d.ts +16 -0
- package/dist/src/components/New/TransferQueue/TransferQueueRow.d.ts +10 -0
- package/dist/src/components/New/TransferQueue/constants.d.ts +6 -0
- package/dist/src/components/New/constants/overlay.d.ts +13 -0
- package/dist/src/components/Popup/constants.d.ts +1 -1
- package/dist/src/components/SchemaRenderer/types.d.ts +11 -0
- package/dist/src/components/SchemaRenderer/utils.d.ts +10 -1
- package/dist/src/constants/public-class-names.d.ts +201 -0
- package/dist/src/index.d.ts +36 -1
- package/dist/src/types/accordion.d.ts +7 -0
- package/dist/src/types/avatar.d.ts +7 -0
- package/dist/src/types/badge.d.ts +16 -0
- package/dist/src/types/breadcrumbs.d.ts +9 -0
- package/dist/src/types/button.d.ts +1 -0
- package/dist/src/types/entity-type.d.ts +9 -0
- package/dist/src/types/transfer-queue.d.ts +10 -0
- package/dist/src/utils/__tests__/avatar.spec.d.ts +1 -0
- package/dist/src/utils/avatar.d.ts +12 -0
- package/dist/src/utils/sub-menu-floating.d.ts +7 -4
- package/dist/types/accordion.js +4 -0
- package/dist/types/avatar.js +4 -0
- package/dist/types/badge.js +5 -0
- package/dist/types/breadcrumbs.js +4 -0
- package/dist/types/button.js +3 -3
- package/dist/types/entity-type.js +4 -0
- package/dist/types/transfer-queue.js +4 -0
- package/dist/use-file-manager-tabs-C-dMqEFy.cjs +3 -0
- package/dist/utils/avatar.js +22 -0
- package/dist/utils/merge-classes.js +12 -5
- package/dist/utils/sub-menu-floating.js +99 -54
- package/package.json +4 -7
- package/dist/DateCellRenderer-ssp7eaZY.cjs +0 -1
- package/dist/IconButton-DWqoaBWf.cjs +0 -1
- package/dist/JsonEditor-qv1Z0dLX.cjs +0 -1
- package/dist/MarkdownEditorContainer-Bzcnoemw.cjs +0 -1
- package/dist/lazy-tfN4sKhq.cjs +0 -1
- package/dist/merge-classes-Dipy1Ih1.cjs +0 -1
- package/dist/use-file-manager-tabs-DjdR_mYM.cjs +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const u=require("react/jsx-runtime"),n=require("@floating-ui/react"),c=require("react"),x=require("classnames"),F=require("./merge-classes-BEJXjzkx.cjs");var l=(e=>(e.Primary="primary",e.Neutral="neutral",e.Danger="danger",e.Static="static",e.Starter="starter",e.Success="success",e.Secondary="secondary",e.Tertiary="tertiary",e))(l||{}),r=(e=>(e.Solid="solid",e.Outlined="outlined",e.Ghost="ghost",e.Link="link",e))(r||{});const v={[l.Primary]:{[r.Solid]:"dial-primary-solid-button",[r.Ghost]:"dial-primary-ghost-button",[r.Link]:"dial-primary-link-button"},[l.Neutral]:{[r.Outlined]:"dial-neutral-outlined-button"},[l.Danger]:{[r.Solid]:"dial-danger-solid-button",[r.Ghost]:"dial-danger-ghost-button",[r.Outlined]:"dial-danger-outlined-button"},[l.Success]:{[r.Ghost]:"dial-success-ghost-button"},[l.Secondary]:{[r.Ghost]:"dial-secondary-ghost-button"},[l.Tertiary]:{[r.Ghost]:"dial-tertiary-ghost-button"},[l.Static]:{},[l.Starter]:{}},S=(e=l.Primary,o=r.Solid)=>{const t=v[e]?.[o];return t||(console.warn(`Could not find Button styles for variant: ${e} and appearance: ${o}. Using default primary solid button styles.`),v[l.Primary][r.Solid])};var h=(e=>(e.Small="small",e.Standard="standard",e.Large="large",e))(h||{});const I=7,A=2,C=c.createContext(null),N=()=>{const e=c.useContext(C);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},q=({initialOpen:e=!1,placement:o="bottom",isTriggerClickable:t=!1,open:s,onOpenChange:a}={})=>{const[i,p]=c.useState(e),g=c.useRef(null),m=s??i,d=a??p,f=n.useFloating({placement:o,open:m,onOpenChange:d,whileElementsMounted:n.autoUpdate,middleware:[n.offset(I+A),n.flip({crossAxis:o.includes("-"),fallbackAxisSideDirection:"start",padding:5}),n.shift({padding:5}),n.arrow({element:g})]}),M=n.useHover(f.context,{move:!1,enabled:s==null,mouseOnly:t,delay:{open:500,close:0}}),k=n.useFocus(f.context,{enabled:s==null}),P=n.useDismiss(f.context),G=n.useRole(f.context,{role:"tooltip"}),b=n.useInteractions([M,k,P,G]);return c.useEffect(()=>{if(!m)return;const y=f.refs.reference.current;if(!(y instanceof Element))return;const w=new IntersectionObserver(([L])=>{L.isIntersecting||d(!1)},{root:null,threshold:0});return w.observe(y),()=>w.disconnect()},[m,f.refs.reference,d]),c.useMemo(()=>({open:m,setOpen:d,arrowRef:g,...b,...f}),[m,d,b,f])},R=({children:e,...o})=>{const t=q(o);return u.jsx(C.Provider,{value:t,children:e})},T="(hover: none)",_=()=>typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(T).matches,D=()=>{const[e,o]=c.useState(()=>!_());return c.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const t=window.matchMedia(T);if(o(!t.matches),typeof t.addEventListener!="function")return;const s=a=>o(!a.matches);return t.addEventListener("change",s),()=>t.removeEventListener("change",s)},[]),e},E=({style:e,...o})=>{const t=N(),s=D(),a=c.useRef(null),i=n.useMergeRefs([t.refs.setFloating,a]);return!t.open||!s?null:u.jsx(n.FloatingPortal,{id:"tooltip-portal",children:u.jsxs("div",{ref:i,style:{...t.floatingStyles,...e},...t.getFloatingProps(o),className:x("z-tooltip whitespace-pre-wrap break-words rounded border border-primary bg-layer-0 px-2 py-1 dial-tiny-text shadow max-w-[300px]",t.getFloatingProps(o).className),children:[o.children,u.jsx(n.FloatingArrow,{ref:t.arrowRef,context:t.context,fill:"currentColor",strokeWidth:1,className:"stroke-primary text-[var(--bg-layer-0,_#000000)]"})]})})},H=({children:e,asChild:o=!1,...t})=>{const s=N(),a=o&&c.isValidElement(e),i=a?e.props?.ref:null,p=n.useMergeRefs([s.refs.setReference,...i?[i]:[]]);return a?c.cloneElement(e,s.getReferenceProps({...e.props,...t,ref:p})):u.jsx("span",{ref:p,...s.getReferenceProps(t),className:t.className??"dial-tooltip-trigger text-start",children:e})},j=({hideTooltip:e,tooltip:o,children:t,triggerClassName:s,contentClassName:a,...i})=>u.jsxs(R,{...i,children:[u.jsx(H,{className:x(s,"truncate"),children:t}),u.jsx(E,{className:x("text-primary",a,"max-w-[300px]",(e||!o)&&"hidden"),children:o})]}),O=(...e)=>e.find(o=>typeof o=="string"&&o.length>0),U=({variant:e,appearance:o=r.Solid,size:t=h.Standard,className:s,icon:a,tooltipProps:i,type:p="button",...g})=>{const m=F.mergeClasses(e&&S(e,o),t===h.Small?"h-[24px] w-[24px]":"h-[40px] w-[40px] dial-kit-enhanced-target","dial-icon-button disabled:cursor-not-allowed focus-visible:outline focus-visible:outline-focus outline-offset-0 disabled:text-controls-secondary-disable",s),d=u.jsx("button",{...g,type:p,className:m,"aria-label":O(g["aria-label"],i?.tooltip),children:a});return i?u.jsx(j,{...i,children:d}):d};exports.ButtonAppearance=r;exports.ButtonVariant=l;exports.DialIconButton=U;exports.DialTooltip=j;exports.DialTooltipContainer=R;exports.DialTooltipContent=E;exports.DialTooltipTrigger=H;exports.ElementSize=h;exports.getButtonClassNames=S;exports.resolveAccessibleName=O;exports.useHasHover=D;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),u=require("./editor-Bc9xzKuR.cjs"),d=require("@monaco-editor/react");function f(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const m=f(d),b=({value:e,onChange:o,onValidateJSON:t,options:a,currentTheme:n,themesConfig:i=u.EDITOR_THEMES_CONFIG})=>{function s(r){r?.editor?.defineTheme(n,i[n]),r.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,enableSchemaRequest:!1,schemas:[{uri:"http://custom-schema/object-required.json",fileMatch:["*"],schema:{type:"object",description:"Top-level value must be an object",additionalProperties:!0}}]})}const{Editor:l}=m;return c.jsx(l,{beforeMount:s,height:"100%",defaultLanguage:"json",value:e,onChange:o,theme:n,onValidate:t,options:{minimap:{enabled:!1},formatOnType:!0,formatOnPaste:!0,selectOnLineNumbers:!1,automaticLayout:!0,scrollBeyondLastLine:!1,wordWrap:"on",smoothScrolling:!0,overviewRulerLanes:0,scrollbar:{horizontal:"hidden",verticalScrollbarSize:4,verticalSliderSize:4},...a??{}}})};exports.DialJsonEditor=b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("@uiw/react-md-editor"),m=require("./lazy-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("@uiw/react-md-editor"),m=require("./lazy-Cy9WobJf.cjs"),u=require("./merge-classes-BEJXjzkx.cjs"),x=({value:t,onChange:s,height:o=300,preview:i="edit",theme:a=m.EditorThemes.dark,className:n,placeholder:r})=>{const d=r!==void 0&&!t;return e.jsxs("div",{"data-color-mode":a,className:u.mergeClasses("relative",n),children:[e.jsx(c,{value:t,onChange:l=>s?.(l||""),height:o,preview:i}),d&&e.jsx("div",{className:"pointer-events-none absolute left-0 top-8 px-2 dial-small-text text-secondary opacity-40",children:r})]})};exports.DialMarkdownEditor=x;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),j=require("react"),O=require("@uiw/react-md-editor"),_=require("./lazy-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),j=require("react"),O=require("@uiw/react-md-editor"),_=require("./lazy-Cy9WobJf.cjs"),k=require("./merge-classes-BEJXjzkx.cjs"),o=require("@tabler/icons-react"),p=require("./icon-DhjrDQ8I.cjs"),f=require("./icon-CrGVkVpG.cjs");function E(n){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const r in n)if(r!=="default"){const c=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(i,r,c.get?c:{enumerable:!0,get:()=>n[r]})}}return i.default=n,Object.freeze(i)}const b=E(O),L=f.DIAL_ICON_SIZE.SM,t={size:L,stroke:p.DIAL_KIT_ICON_STROKE},s=(n,i)=>({...n,icon:i}),M=()=>{const{bold:n,code:i,divider:r,group:c,heading1:a,heading2:d,heading3:u,italic:l,link:m,orderedListCommand:I,quote:x,strikethrough:g,table:h,unorderedListCommand:C}=b;return[s(n,e.jsx(o.IconBold,{...t})),s(l,e.jsx(o.IconItalic,{...t})),s(g,e.jsx(o.IconStrikethrough,{...t})),r,c([a,d,u],{name:"heading",groupName:"heading",icon:e.jsx(o.IconTextSize,{...t}),buttonProps:{"aria-label":"Text style",title:"Text style"}}),r,s(C,e.jsx(o.IconList,{...t})),s(I,e.jsx(o.IconListNumbers,{...t})),r,s(x,e.jsx(o.IconQuote,{...t})),s(m,e.jsx(o.IconLink,{...t})),s(i,e.jsx(o.IconCode,{...t})),r,s(h,e.jsx(o.IconTable,{...t}))]},S=()=>{const{codeEdit:n,codeLive:i,codePreview:r,divider:c,fullscreen:a}=b;return[s(n,e.jsx(o.IconPencil,{...t})),s(i,e.jsx(o.IconLayoutColumns,{...t})),s(r,e.jsx(o.IconEye,{...t})),c,s(a,e.jsx(o.IconMaximize,{...t}))]},T=({value:n,onChange:i,height:r=300,theme:c=_.EditorThemes.light,className:a,placeholder:d,defaultPreview:u="edit",id:l,ariaLabel:m})=>{const I=j.useMemo(()=>M(),[]),x=j.useMemo(()=>S(),[]);return e.jsx("div",{"data-color-mode":c,className:k.mergeClasses("dial-kit-markdown-editor",a),children:e.jsx(O,{value:n,onChange:g=>i?.(g||""),height:r,preview:u,commands:I,extraCommands:x,textareaProps:{placeholder:d,id:l,"aria-label":m}})})};exports.MarkdownEditor=T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react");require("./editor-Bc9xzKuR.cjs");const E=require("./lazy-Cy9WobJf.cjs");require("@monaco-editor/react");const m=require("./Switch-DE6MrcqJ.cjs"),N=require("./MarkdownEditor-CPzMv3lE.cjs"),b=({value:o,onChangeValue:l,label:i,headerContent:a,switcherLabel:d,height:c=300,theme:u=E.EditorThemes.dark,onValidateJSON:x,preview:j="edit"})=>{const w=n.useId(),[t,C]=n.useState(!1),[f,p]=n.useState(null);n.useEffect(()=>{t&&typeof window<"u"&&Promise.resolve().then(()=>require("./JsonEditor-CpSpVa0v.cjs")).then(s=>{p(()=>s.DialJsonEditor)})},[t]);const h=n.useCallback(s=>{l?.(s)},[l]),S=n.useCallback(s=>{x?.(s)},[x]),r=!!d;return e.jsx("div",{className:"size-full flex flex-col",children:e.jsx("div",{className:"flex flex-col gap-8",children:e.jsxs("div",{children:[(i||a||r)&&e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[i&&e.jsx(m.DialLabel,{label:i}),e.jsxs("div",{className:"flex items-center gap-2 flex-1 justify-end",children:[a,r&&e.jsx("label",{className:"flex items-center gap-2 cursor-pointer",children:e.jsx(m.DialSwitch,{isOn:t,label:d,switchId:w,onChange:s=>C(s)})})]})]}),r&&t?e.jsx("div",{className:"border border-primary rounded",style:{height:`${c}px`},children:f&&e.jsx(f,{value:o,onChange:h,onValidateJSON:S,currentTheme:u})}):e.jsx(N.DialMarkdownEditor,{value:o,onChange:h,height:c,preview:j,theme:u})]})})})};exports.DialMarkdownEditorContainer=b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),p=require("./merge-classes-
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),p=require("./merge-classes-BEJXjzkx.cjs"),d=require("@tabler/icons-react"),i=require("./IconButton-DHOFapLo.cjs"),f=require("./icon-CrGVkVpG.cjs"),l=require("classnames"),h=require("react"),y="w-[24px] h-[24px] border border-solid rounded-[6px] border-transparent flex items-center justify-center text-secondary hover:text-controls-accent-primary-hover active:text-controls-accent-primary-active",o=({caption:t,onClick:a})=>{if(!t)return null;const s=e.jsx(i.DialIconButton,{"aria-label":t,className:y,icon:e.jsx(d.IconInfoCircle,{size:f.DIAL_ICON_SIZE.SM}),onClick:a});return t?e.jsx(i.DialTooltip,{tooltip:t,triggerClassName:"flex justify-center items-center",children:s}):s},j=({label:t,required:a,className:s,caption:r,...n})=>t?e.jsxs("label",{...n,className:p.mergeClasses("dial-tiny-text text-secondary flex items-center gap-1",s),children:[typeof t=="string"?e.jsx("span",{className:"min-h-4",children:t}):t,a&&e.jsx("span",{className:"text-accent-primary",children:"*"}),e.jsx(o,{caption:r})]}):null,N=({label:t,switchId:a,isOn:s=!1,disabled:r,onChange:n,caption:c})=>{const x=l("flex shrink-0 w-[36px] h-[18px] cursor-pointer items-center gap-1 rounded-full p-0.5 transition-all duration-200",s?"flex-row-reverse":"flex-row",r?"pointer-events-none":"",r?s?"bg-controls-disable":"bg-layer-4":s?"bg-accent-primary":"bg-layer-4"),m=h.useCallback(u=>{u.stopPropagation(),n?.(!s)},[n,s]);return e.jsxs("div",{className:"flex flex-row items-start",role:"switch",children:[e.jsx("input",{type:"checkbox",onChange:m,id:a,disabled:r,className:"invisible size-0",checked:s}),e.jsx("label",{htmlFor:a,className:x,"aria-describedby":c&&"caption",children:e.jsx("span",{className:l("size-3 rounded-full",r?"bg-controls-disable-accent":"bg-controls-enable-primary")})}),(t||c)&&e.jsxs("div",{className:"flex flex-col gap-1 ml-2",children:[t&&e.jsx("span",{className:l("dial-small-text py-[1px]",r?"text-secondary":"text-primary"),"aria-label":"switch-title",children:t}),c&&e.jsx("span",{id:"caption",className:"dial-tiny-text text-secondary",children:c})]})]})};exports.DialInfoButton=o;exports.DialLabel=j;exports.DialSwitch=N;
|
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import { ButtonVariant as
|
|
1
|
+
import { ButtonVariant as a, ButtonAppearance as t } from "../../types/button.js";
|
|
2
2
|
const i = {
|
|
3
|
-
[
|
|
3
|
+
[a.Primary]: {
|
|
4
4
|
[t.Solid]: "dial-primary-solid-button",
|
|
5
5
|
[t.Ghost]: "dial-primary-ghost-button",
|
|
6
6
|
[t.Link]: "dial-primary-link-button"
|
|
7
7
|
},
|
|
8
|
-
[
|
|
8
|
+
[a.Neutral]: {
|
|
9
9
|
[t.Outlined]: "dial-neutral-outlined-button"
|
|
10
10
|
},
|
|
11
|
-
[
|
|
11
|
+
[a.Danger]: {
|
|
12
12
|
[t.Solid]: "dial-danger-solid-button",
|
|
13
13
|
[t.Ghost]: "dial-danger-ghost-button",
|
|
14
14
|
[t.Outlined]: "dial-danger-outlined-button"
|
|
15
15
|
},
|
|
16
|
-
[
|
|
16
|
+
[a.Success]: {
|
|
17
17
|
[t.Ghost]: "dial-success-ghost-button"
|
|
18
18
|
},
|
|
19
|
-
[
|
|
19
|
+
[a.Secondary]: {
|
|
20
20
|
[t.Ghost]: "dial-secondary-ghost-button"
|
|
21
21
|
},
|
|
22
|
-
[
|
|
22
|
+
[a.Tertiary]: {
|
|
23
23
|
[t.Ghost]: "dial-tertiary-ghost-button"
|
|
24
24
|
},
|
|
25
|
-
[
|
|
25
|
+
[a.Static]: {},
|
|
26
|
+
[a.Starter]: {}
|
|
26
27
|
};
|
|
27
28
|
export {
|
|
28
29
|
i as variantClassMap
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { jsxs as v, Fragment as N, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { useFloating as ce, autoUpdate as de, offset as fe, autoPlacement as ue, flip as pe, shift as me, size as he, useClick as ye, useHover as xe, useDismiss as ge, useRole as we, useInteractions as
|
|
2
|
+
import { useFloating as ce, autoUpdate as de, offset as fe, autoPlacement as ue, flip as pe, shift as me, size as he, useClick as ye, useHover as xe, useDismiss as ge, useRole as we, useInteractions as Ce, FloatingPortal as be, FloatingFocusManager as ve } from "@floating-ui/react";
|
|
3
3
|
import m from "classnames";
|
|
4
4
|
import { useState as Ne, useRef as Pe, useCallback as h, useId as ke, useEffect as U, useMemo as De } from "react";
|
|
5
|
-
import { DialIcon as
|
|
5
|
+
import { DialIcon as Ie } from "../Icon/Icon.js";
|
|
6
|
+
import { DIAL_KIT_CLASS as Me } from "../../constants/public-class-names.js";
|
|
6
7
|
import { DropdownTrigger as y, DropdownItemType as X } from "../../types/dropdown.js";
|
|
7
|
-
import { dropdownGap as x, dropdownDividerClassName as
|
|
8
|
-
import { DialCloseButton as
|
|
9
|
-
import { mergeClasses as
|
|
10
|
-
import { DropdownSubMenuItem as
|
|
11
|
-
const
|
|
8
|
+
import { dropdownGap as x, dropdownDividerClassName as Ee, dropdownItemBaseClassName as Fe, dropdownItemDisabledClassName as Re, dropdownItemDangerClassName as Ae, dropdownBaseClassName as Be, dropdownListBaseClassName as Le } from "./constants.js";
|
|
9
|
+
import { DialCloseButton as Se } from "../CloseButton/CloseButton.js";
|
|
10
|
+
import { mergeClasses as I } from "../../utils/merge-classes.js";
|
|
11
|
+
import { DropdownSubMenuItem as $e } from "./DropdownSubMenuItem.js";
|
|
12
|
+
const We = (c) => "clientWidth" in c ? c.clientWidth : c.getBoundingClientRect?.()?.width ?? 0, Je = ({
|
|
12
13
|
children: c,
|
|
13
14
|
items: g,
|
|
14
|
-
onItemClick:
|
|
15
|
+
onItemClick: M,
|
|
15
16
|
menuHeader: d,
|
|
16
17
|
menuFooter: f,
|
|
17
18
|
renderOverlay: P,
|
|
@@ -21,51 +22,51 @@ const je = (c) => "clientWidth" in c ? c.clientWidth : c.getBoundingClientRect?.
|
|
|
21
22
|
open: F,
|
|
22
23
|
defaultOpen: Y = !1,
|
|
23
24
|
onOpenChange: R,
|
|
24
|
-
closable:
|
|
25
|
-
onClose:
|
|
26
|
-
className:
|
|
27
|
-
overlayContentClassName:
|
|
28
|
-
separatorClassName:
|
|
29
|
-
listClassName:
|
|
30
|
-
outsidePressIgnoreRef:
|
|
31
|
-
outsideClosable:
|
|
32
|
-
allowedPlacements:
|
|
25
|
+
closable: _ = !1,
|
|
26
|
+
onClose: z,
|
|
27
|
+
className: G,
|
|
28
|
+
overlayContentClassName: A,
|
|
29
|
+
separatorClassName: B,
|
|
30
|
+
listClassName: K,
|
|
31
|
+
outsidePressIgnoreRef: L,
|
|
32
|
+
outsideClosable: T = !0,
|
|
33
|
+
allowedPlacements: q,
|
|
33
34
|
anchorToMouse: w = !1,
|
|
34
35
|
matchReferenceWidth: k = !0,
|
|
35
|
-
maxDropdownHeight:
|
|
36
|
+
maxDropdownHeight: S
|
|
36
37
|
}) => {
|
|
37
|
-
const [
|
|
38
|
+
const [J, Q] = Ne(Y), D = F !== void 0, s = D ? !!F : J, C = Pe(null), n = h(
|
|
38
39
|
(e) => {
|
|
39
|
-
D ||
|
|
40
|
+
D || Q(e), R?.(e);
|
|
40
41
|
},
|
|
41
42
|
[D, R]
|
|
42
|
-
),
|
|
43
|
+
), $ = ke(), V = E === void 0, { refs: a, floatingStyles: Z, context: u } = ce({
|
|
43
44
|
placement: E,
|
|
44
45
|
open: s,
|
|
45
46
|
onOpenChange: n,
|
|
46
47
|
whileElementsMounted: de,
|
|
47
48
|
middleware: [
|
|
48
49
|
fe({ mainAxis: x, crossAxis: 0 }),
|
|
49
|
-
|
|
50
|
+
V ? ue({
|
|
50
51
|
alignment: "start",
|
|
51
52
|
crossAxis: !0,
|
|
52
53
|
padding: x,
|
|
53
|
-
allowedPlacements:
|
|
54
|
+
allowedPlacements: q
|
|
54
55
|
}) : pe({ padding: x }),
|
|
55
56
|
me({ padding: x }),
|
|
56
57
|
he({
|
|
57
58
|
padding: x,
|
|
58
59
|
apply({ availableWidth: e, availableHeight: t, elements: p }) {
|
|
59
|
-
const l = p.floating,
|
|
60
|
+
const l = p.floating, j = We(p.reference);
|
|
60
61
|
l.style.setProperty(
|
|
61
62
|
"--fui-available-height",
|
|
62
63
|
`${Math.floor(t)}px`
|
|
63
64
|
), l.style.setProperty(
|
|
64
65
|
"--reference-width",
|
|
65
|
-
k ? `${Math.round(
|
|
66
|
-
), k ? l.style.minWidth = `${Math.round(
|
|
67
|
-
const
|
|
68
|
-
l.style.maxHeight = `${
|
|
66
|
+
k ? `${Math.round(j)}px` : "0px"
|
|
67
|
+
), k ? l.style.minWidth = `${Math.round(j)}px` : l.style.removeProperty("min-width"), l.style.maxWidth = `${Math.floor(e)}px`;
|
|
68
|
+
const O = Math.floor(t);
|
|
69
|
+
l.style.maxHeight = `${S ? Math.min(O, S) : O}px`;
|
|
69
70
|
}
|
|
70
71
|
})
|
|
71
72
|
]
|
|
@@ -80,16 +81,16 @@ const je = (c) => "clientWidth" in c ? c.clientWidth : c.getBoundingClientRect?.
|
|
|
80
81
|
bubbles: !0,
|
|
81
82
|
referencePress: !1,
|
|
82
83
|
outsidePress: (e) => {
|
|
83
|
-
if (!
|
|
84
|
+
if (!T) return !1;
|
|
84
85
|
const t = e.target;
|
|
85
|
-
return !(
|
|
86
|
+
return !(L?.current && t instanceof Node && L.current.contains(t));
|
|
86
87
|
}
|
|
87
|
-
}), ne = we(u, { role: "menu" }), { getReferenceProps: oe, getFloatingProps: re } =
|
|
88
|
+
}), ne = we(u, { role: "menu" }), { getReferenceProps: oe, getFloatingProps: re } = Ce([
|
|
88
89
|
H,
|
|
89
90
|
ee,
|
|
90
91
|
te,
|
|
91
92
|
ne
|
|
92
|
-
]),
|
|
93
|
+
]), b = h(
|
|
93
94
|
(e, t) => {
|
|
94
95
|
a.setPositionReference({
|
|
95
96
|
getBoundingClientRect: () => ({
|
|
@@ -107,51 +108,55 @@ const je = (c) => "clientWidth" in c ? c.clientWidth : c.getBoundingClientRect?.
|
|
|
107
108
|
[a]
|
|
108
109
|
), se = h(
|
|
109
110
|
(e) => {
|
|
110
|
-
!i.includes(y.ContextMenu) || r || (e.preventDefault(), w && (
|
|
111
|
+
!i.includes(y.ContextMenu) || r || (e.preventDefault(), w && (b(e.clientX, e.clientY), C.current = document.elementFromPoint(
|
|
111
112
|
e.clientX,
|
|
112
113
|
e.clientY
|
|
113
114
|
)), n(!0));
|
|
114
115
|
},
|
|
115
|
-
[w, r, n,
|
|
116
|
+
[w, r, n, b, i]
|
|
116
117
|
), le = h(
|
|
117
118
|
(e) => {
|
|
118
|
-
!w || r || (i.includes(y.ContextMenu) && s && n(!1),
|
|
119
|
+
!w || r || (i.includes(y.ContextMenu) && s && n(!1), b(e.clientX, e.clientY), C.current = document.elementFromPoint(
|
|
119
120
|
e.clientX,
|
|
120
121
|
e.clientY
|
|
121
122
|
));
|
|
122
123
|
},
|
|
123
|
-
[w, r,
|
|
124
|
+
[w, r, b, s, i, n]
|
|
124
125
|
);
|
|
125
126
|
U(() => {
|
|
126
127
|
r && s && n(!1);
|
|
127
128
|
}, [r, s, n]);
|
|
128
|
-
const
|
|
129
|
+
const W = h(
|
|
129
130
|
(e) => (t) => {
|
|
130
|
-
e.disabled || (e.onClick?.({ key: e.key, domEvent: t }),
|
|
131
|
+
e.disabled || (e.onClick?.({ key: e.key, domEvent: t }), M?.({ key: e.key, domEvent: t }), n(!1));
|
|
131
132
|
},
|
|
132
|
-
[
|
|
133
|
+
[M, n]
|
|
133
134
|
), ie = De(() => P ? P() : g ? /* @__PURE__ */ v(N, { children: [
|
|
134
135
|
d && /* @__PURE__ */ o(N, { children: typeof d == "function" ? d() : d }),
|
|
135
136
|
/* @__PURE__ */ o(
|
|
136
137
|
"div",
|
|
137
138
|
{
|
|
138
139
|
role: "none",
|
|
139
|
-
className:
|
|
140
|
+
className: I(
|
|
141
|
+
"py-1",
|
|
142
|
+
A,
|
|
143
|
+
Me.dropdownList
|
|
144
|
+
),
|
|
140
145
|
"aria-label": "dropdown",
|
|
141
146
|
children: g.map((e) => e.type === X.Divider ? /* @__PURE__ */ o(
|
|
142
147
|
"div",
|
|
143
148
|
{
|
|
144
149
|
role: "separator",
|
|
145
|
-
className:
|
|
146
|
-
|
|
147
|
-
|
|
150
|
+
className: I(
|
|
151
|
+
Ee,
|
|
152
|
+
B
|
|
148
153
|
)
|
|
149
154
|
},
|
|
150
155
|
e.key
|
|
151
156
|
) : e.type === X.PlainText ? /* @__PURE__ */ o(
|
|
152
157
|
"div",
|
|
153
158
|
{
|
|
154
|
-
className:
|
|
159
|
+
className: I(
|
|
155
160
|
"px-3 py-2 text-secondary dial-caption-text",
|
|
156
161
|
e.className
|
|
157
162
|
),
|
|
@@ -159,7 +164,7 @@ const je = (c) => "clientWidth" in c ? c.clientWidth : c.getBoundingClientRect?.
|
|
|
159
164
|
},
|
|
160
165
|
e.key
|
|
161
166
|
) : e.children?.length ? /* @__PURE__ */ o(
|
|
162
|
-
|
|
167
|
+
$e,
|
|
163
168
|
{
|
|
164
169
|
item: e,
|
|
165
170
|
onRootClose: () => n(!1)
|
|
@@ -172,13 +177,13 @@ const je = (c) => "clientWidth" in c ? c.clientWidth : c.getBoundingClientRect?.
|
|
|
172
177
|
type: "button",
|
|
173
178
|
"aria-disabled": !!e.disabled,
|
|
174
179
|
className: m(
|
|
175
|
-
|
|
176
|
-
e.disabled &&
|
|
177
|
-
e.danger &&
|
|
180
|
+
Fe,
|
|
181
|
+
e.disabled && Re,
|
|
182
|
+
e.danger && Ae,
|
|
178
183
|
e.className
|
|
179
184
|
),
|
|
180
185
|
disabled: e.disabled,
|
|
181
|
-
onClick:
|
|
186
|
+
onClick: W(e),
|
|
182
187
|
children: [
|
|
183
188
|
e.icon && /* @__PURE__ */ o(
|
|
184
189
|
"span",
|
|
@@ -187,7 +192,7 @@ const je = (c) => "clientWidth" in c ? c.clientWidth : c.getBoundingClientRect?.
|
|
|
187
192
|
e.danger && "text-error",
|
|
188
193
|
e.disabled && "text-secondary"
|
|
189
194
|
),
|
|
190
|
-
children: /* @__PURE__ */ o(
|
|
195
|
+
children: /* @__PURE__ */ o(Ie, { icon: e.icon })
|
|
191
196
|
}
|
|
192
197
|
),
|
|
193
198
|
/* @__PURE__ */ o(
|
|
@@ -210,14 +215,14 @@ const je = (c) => "clientWidth" in c ? c.clientWidth : c.getBoundingClientRect?.
|
|
|
210
215
|
),
|
|
211
216
|
f && /* @__PURE__ */ o(N, { children: typeof f == "function" ? f() : f })
|
|
212
217
|
] }) : null, [
|
|
213
|
-
|
|
218
|
+
W,
|
|
214
219
|
g,
|
|
215
220
|
f,
|
|
216
221
|
d,
|
|
217
222
|
P,
|
|
218
223
|
n,
|
|
219
|
-
|
|
220
|
-
|
|
224
|
+
A,
|
|
225
|
+
B
|
|
221
226
|
]), ae = oe({
|
|
222
227
|
onContextMenu: se,
|
|
223
228
|
onMouseDown: le
|
|
@@ -226,7 +231,7 @@ const je = (c) => "clientWidth" in c ? c.clientWidth : c.getBoundingClientRect?.
|
|
|
226
231
|
if (!s) return;
|
|
227
232
|
const e = a.reference.current;
|
|
228
233
|
let t = null;
|
|
229
|
-
if (e instanceof Element ? t = e :
|
|
234
|
+
if (e instanceof Element ? t = e : C.current instanceof Element && (t = C.current), !t) return;
|
|
230
235
|
const p = new IntersectionObserver(
|
|
231
236
|
([l]) => {
|
|
232
237
|
l.isIntersecting || n(!1);
|
|
@@ -242,16 +247,16 @@ const je = (c) => "clientWidth" in c ? c.clientWidth : c.getBoundingClientRect?.
|
|
|
242
247
|
className: m(
|
|
243
248
|
Be,
|
|
244
249
|
r && "!cursor-not-allowed opacity-75",
|
|
245
|
-
|
|
250
|
+
G
|
|
246
251
|
),
|
|
247
252
|
"aria-haspopup": "menu",
|
|
248
253
|
"aria-expanded": s,
|
|
249
|
-
"aria-controls":
|
|
254
|
+
"aria-controls": $,
|
|
250
255
|
...ae,
|
|
251
256
|
children: c
|
|
252
257
|
}
|
|
253
258
|
),
|
|
254
|
-
s && /* @__PURE__ */ o(
|
|
259
|
+
s && /* @__PURE__ */ o(be, { children: /* @__PURE__ */ o(
|
|
255
260
|
ve,
|
|
256
261
|
{
|
|
257
262
|
context: u,
|
|
@@ -261,22 +266,22 @@ const je = (c) => "clientWidth" in c ? c.clientWidth : c.getBoundingClientRect?.
|
|
|
261
266
|
children: /* @__PURE__ */ v(
|
|
262
267
|
"div",
|
|
263
268
|
{
|
|
264
|
-
id:
|
|
269
|
+
id: $,
|
|
265
270
|
ref: a.setFloating,
|
|
266
|
-
style:
|
|
271
|
+
style: Z,
|
|
267
272
|
className: m(
|
|
268
|
-
|
|
273
|
+
Le,
|
|
269
274
|
!k && "w-max",
|
|
270
|
-
|
|
275
|
+
K
|
|
271
276
|
),
|
|
272
277
|
...re(),
|
|
273
278
|
children: [
|
|
274
|
-
|
|
275
|
-
|
|
279
|
+
_ && /* @__PURE__ */ o("div", { className: "flex items-center justify-between px-2 pt-2", children: /* @__PURE__ */ o(
|
|
280
|
+
Se,
|
|
276
281
|
{
|
|
277
282
|
ariaLabel: "Close dropdown",
|
|
278
283
|
onClose: (e) => {
|
|
279
|
-
|
|
284
|
+
z?.(e), n(!1);
|
|
280
285
|
}
|
|
281
286
|
}
|
|
282
287
|
) }),
|
|
@@ -289,5 +294,5 @@ const je = (c) => "clientWidth" in c ? c.clientWidth : c.getBoundingClientRect?.
|
|
|
289
294
|
] });
|
|
290
295
|
};
|
|
291
296
|
export {
|
|
292
|
-
|
|
297
|
+
Je as DialDropdown
|
|
293
298
|
};
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import { jsxs as r, Fragment as
|
|
1
|
+
import { jsxs as r, Fragment as N, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import n from "classnames";
|
|
3
3
|
import { useCallback as y } from "react";
|
|
4
4
|
import { DialIcon as l } from "../Icon/Icon.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
5
|
+
import { DIAL_KIT_CLASS as g } from "../../constants/public-class-names.js";
|
|
6
|
+
import { useSubMenuFloating as C, SubMenuPanel as k } from "../../utils/sub-menu-floating.js";
|
|
7
|
+
import { dropdownGap as I, submenuCaretIcon as w, dropdownItemBaseClassName as i, dropdownItemDisabledClassName as m, dropdownItemDangerClassName as S } from "./constants.js";
|
|
8
|
+
const A = ({
|
|
8
9
|
item: a,
|
|
9
10
|
onRootClose: o
|
|
10
11
|
}) => {
|
|
11
12
|
const {
|
|
12
13
|
isOpen: t,
|
|
13
14
|
refs: d,
|
|
14
|
-
floatingStyles:
|
|
15
|
-
context:
|
|
16
|
-
getReferenceProps:
|
|
15
|
+
floatingStyles: c,
|
|
16
|
+
context: p,
|
|
17
|
+
getReferenceProps: b,
|
|
17
18
|
getFloatingProps: u
|
|
18
|
-
} =
|
|
19
|
-
(e) => (
|
|
20
|
-
e.disabled || (e.onClick?.({ key: e.key, domEvent:
|
|
19
|
+
} = C(I, "menu", !!a.disabled), x = y(
|
|
20
|
+
(e) => (f) => {
|
|
21
|
+
e.disabled || (e.onClick?.({ key: e.key, domEvent: f }), o());
|
|
21
22
|
},
|
|
22
23
|
[o]
|
|
23
24
|
);
|
|
24
|
-
return /* @__PURE__ */ r(
|
|
25
|
+
return /* @__PURE__ */ r(N, { children: [
|
|
25
26
|
/* @__PURE__ */ r(
|
|
26
27
|
"button",
|
|
27
28
|
{
|
|
@@ -33,11 +34,11 @@ const v = ({
|
|
|
33
34
|
"aria-disabled": !!a.disabled,
|
|
34
35
|
disabled: a.disabled,
|
|
35
36
|
className: n(
|
|
36
|
-
|
|
37
|
-
a.disabled &&
|
|
37
|
+
i,
|
|
38
|
+
a.disabled && m,
|
|
38
39
|
a.className
|
|
39
40
|
),
|
|
40
|
-
...
|
|
41
|
+
...b(),
|
|
41
42
|
children: [
|
|
42
43
|
a.icon && /* @__PURE__ */ s("span", { className: n(a.disabled && "text-secondary"), children: /* @__PURE__ */ s(l, { icon: a.icon }) }),
|
|
43
44
|
/* @__PURE__ */ s(
|
|
@@ -67,55 +68,62 @@ const v = ({
|
|
|
67
68
|
k,
|
|
68
69
|
{
|
|
69
70
|
refs: d,
|
|
70
|
-
floatingStyles:
|
|
71
|
-
context:
|
|
71
|
+
floatingStyles: c,
|
|
72
|
+
context: p,
|
|
72
73
|
getFloatingProps: u,
|
|
73
74
|
role: "menu",
|
|
74
75
|
className: "w-max",
|
|
75
|
-
children: /* @__PURE__ */ s(
|
|
76
|
-
"
|
|
76
|
+
children: /* @__PURE__ */ s(
|
|
77
|
+
"div",
|
|
77
78
|
{
|
|
78
|
-
role: "
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
79
|
+
role: "none",
|
|
80
|
+
className: n("py-1", g.dropdownList),
|
|
81
|
+
children: a.children.map((e) => /* @__PURE__ */ r(
|
|
82
|
+
"button",
|
|
83
|
+
{
|
|
84
|
+
role: "menuitem",
|
|
85
|
+
type: "button",
|
|
86
|
+
"aria-disabled": !!e.disabled,
|
|
87
|
+
disabled: e.disabled,
|
|
88
|
+
className: n(
|
|
89
|
+
i,
|
|
90
|
+
e.disabled && m,
|
|
91
|
+
e.danger && S,
|
|
92
|
+
e.className
|
|
93
|
+
),
|
|
94
|
+
onClick: x(e),
|
|
95
|
+
children: [
|
|
96
|
+
e.icon && /* @__PURE__ */ s(
|
|
97
|
+
"span",
|
|
98
|
+
{
|
|
99
|
+
className: n(
|
|
100
|
+
e.danger && "text-error",
|
|
101
|
+
e.disabled && "text-secondary"
|
|
102
|
+
),
|
|
103
|
+
children: /* @__PURE__ */ s(l, { icon: e.icon })
|
|
104
|
+
}
|
|
96
105
|
),
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
)
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
)) })
|
|
106
|
+
/* @__PURE__ */ s(
|
|
107
|
+
"span",
|
|
108
|
+
{
|
|
109
|
+
className: n(
|
|
110
|
+
"flex-1 truncate text-start",
|
|
111
|
+
e.danger && "text-error",
|
|
112
|
+
e.disabled && "text-secondary"
|
|
113
|
+
),
|
|
114
|
+
children: e.label
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
e.key
|
|
120
|
+
))
|
|
121
|
+
}
|
|
122
|
+
)
|
|
115
123
|
}
|
|
116
124
|
)
|
|
117
125
|
] });
|
|
118
126
|
};
|
|
119
127
|
export {
|
|
120
|
-
|
|
128
|
+
A as DropdownSubMenuItem
|
|
121
129
|
};
|
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import o from "classnames";
|
|
3
3
|
import { IconChevronRight as r } from "@tabler/icons-react";
|
|
4
|
-
|
|
4
|
+
import { DIAL_KIT_CLASS as s } from "../../constants/public-class-names.js";
|
|
5
|
+
const i = o(
|
|
5
6
|
"flex items-center gap-2 align-middle",
|
|
6
7
|
"h-auto px-0 bg-transparent border-0"
|
|
7
|
-
),
|
|
8
|
-
"z-
|
|
9
|
-
),
|
|
8
|
+
), m = o(
|
|
9
|
+
"z-floating overflow-auto rounded bg-layer-0 text-primary shadow focus-visible:outline-none"
|
|
10
|
+
), l = o(
|
|
10
11
|
"flex w-full cursor-pointer items-center gap-3",
|
|
11
12
|
"focus-visible:border-none focus-visible:outline-none",
|
|
12
13
|
"hover:bg-accent-primary-alpha px-3",
|
|
13
|
-
"dial-small-text h-[34px] rounded text-primary"
|
|
14
|
-
|
|
14
|
+
"dial-small-text h-[34px] rounded text-primary",
|
|
15
|
+
s.menuItem
|
|
16
|
+
), p = "opacity-75 !cursor-not-allowed", c = "text-error", u = "my-1 border-t border-hover border-secondary", b = 4, f = /* @__PURE__ */ e(r, { size: 14 });
|
|
15
17
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
i as dropdownBaseClassName,
|
|
19
|
+
u as dropdownDividerClassName,
|
|
20
|
+
b as dropdownGap,
|
|
21
|
+
l as dropdownItemBaseClassName,
|
|
22
|
+
c as dropdownItemDangerClassName,
|
|
23
|
+
p as dropdownItemDisabledClassName,
|
|
24
|
+
m as dropdownListBaseClassName,
|
|
25
|
+
f as submenuCaretIcon
|
|
24
26
|
};
|