@nextui-org/react 1.0.0-beta.7 → 1.0.0-beta.8
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/cjs/avatar/avatar.js +1 -1
- package/cjs/avatar/avatar.styles.js +1 -1
- package/cjs/button/button-icon.js +1 -1
- package/cjs/button/button.js +1 -1
- package/cjs/button/button.styles.js +1 -1
- package/cjs/card/card.js +1 -1
- package/cjs/card/card.styles.js +1 -1
- package/cjs/card/index.js +1 -1
- package/cjs/card/use-card.js +1 -0
- package/cjs/checkbox/checkbox-group.js +1 -1
- package/cjs/checkbox/checkbox.styles.js +1 -1
- package/cjs/checkbox/use-checkbox-group.js +1 -1
- package/cjs/collapse/collapse.styles.js +1 -1
- package/cjs/css-baseline/css-baseline.js +1 -1
- package/cjs/dropdown/base/dropdown-item-base.js +1 -0
- package/cjs/dropdown/dropdown-button.js +1 -0
- package/cjs/dropdown/dropdown-context.js +1 -0
- package/cjs/dropdown/dropdown-icon.js +1 -0
- package/cjs/dropdown/dropdown-item.js +1 -0
- package/cjs/dropdown/dropdown-menu.js +1 -0
- package/cjs/dropdown/dropdown-section.js +1 -0
- package/cjs/dropdown/dropdown-trigger.js +1 -0
- package/cjs/dropdown/dropdown-types.js +1 -0
- package/cjs/dropdown/dropdown.js +1 -0
- package/cjs/dropdown/dropdown.styles.js +1 -0
- package/cjs/dropdown/index.js +1 -0
- package/cjs/dropdown/use-dropdown.js +1 -0
- package/cjs/image/image.js +1 -1
- package/cjs/image/image.styles.js +1 -1
- package/cjs/index.js +1 -1
- package/cjs/input/input.styles.js +1 -1
- package/cjs/modal/modal.styles.js +1 -1
- package/cjs/pagination/pagination.styles.js +1 -1
- package/cjs/popover/popover-content.js +1 -1
- package/cjs/popover/popover-trigger.js +1 -1
- package/cjs/popover/popover.js +1 -1
- package/cjs/popover/popover.styles.js +1 -1
- package/cjs/popover/use-popover.js +1 -1
- package/cjs/popover/utils.js +1 -1
- package/cjs/radio/index.js +1 -1
- package/cjs/radio/radio-context.js +1 -1
- package/cjs/radio/radio-group.js +1 -1
- package/cjs/radio/radio.js +1 -1
- package/cjs/radio/radio.styles.js +1 -1
- package/cjs/radio/use-radio-group.js +1 -0
- package/cjs/radio/use-radio.js +1 -0
- package/cjs/snippet/snippet.styles.js +1 -1
- package/cjs/switch/switch.styles.js +1 -1
- package/cjs/table/table.styles.js +1 -1
- package/cjs/theme/colors/gray.js +1 -1
- package/cjs/theme/common.js +1 -1
- package/cjs/theme/dark-theme.js +1 -1
- package/cjs/theme/light-theme.js +1 -1
- package/cjs/theme/shared-css.js +1 -0
- package/cjs/theme/stitches.config.js +1 -1
- package/cjs/tooltip/tooltip.styles.js +1 -1
- package/cjs/user/index.js +1 -1
- package/cjs/user/user-link.js +1 -1
- package/cjs/user/user.js +1 -1
- package/cjs/user/user.styles.js +1 -1
- package/cjs/utils/checkmark.js +1 -0
- package/cjs/utils/color.js +1 -1
- package/cjs/utils/dom.js +1 -1
- package/cjs/utils/icons.js +1 -1
- package/cjs/utils/prop-types.js +1 -1
- package/dropdown/package.json +6 -0
- package/esm/avatar/avatar.js +1 -1
- package/esm/avatar/avatar.styles.js +1 -1
- package/esm/button/button-icon.js +1 -1
- package/esm/button/button.js +1 -1
- package/esm/button/button.styles.js +1 -1
- package/esm/card/card.js +1 -1
- package/esm/card/card.styles.js +1 -1
- package/esm/card/index.js +1 -1
- package/esm/card/use-card.js +1 -0
- package/esm/checkbox/checkbox-group.js +1 -1
- package/esm/checkbox/checkbox.styles.js +1 -1
- package/esm/checkbox/use-checkbox-group.js +1 -1
- package/esm/collapse/collapse.styles.js +1 -1
- package/esm/css-baseline/css-baseline.js +1 -1
- package/esm/dropdown/base/dropdown-item-base.js +1 -0
- package/esm/dropdown/dropdown-button.js +1 -0
- package/esm/dropdown/dropdown-context.js +1 -0
- package/esm/dropdown/dropdown-icon.js +1 -0
- package/esm/dropdown/dropdown-item.js +1 -0
- package/esm/dropdown/dropdown-menu.js +1 -0
- package/esm/dropdown/dropdown-section.js +1 -0
- package/esm/dropdown/dropdown-trigger.js +1 -0
- package/esm/dropdown/dropdown-types.js +1 -0
- package/esm/dropdown/dropdown.js +1 -0
- package/esm/dropdown/dropdown.styles.js +1 -0
- package/esm/dropdown/index.js +1 -0
- package/esm/dropdown/use-dropdown.js +1 -0
- package/esm/image/image.js +1 -1
- package/esm/image/image.styles.js +1 -1
- package/esm/index.js +1 -1
- package/esm/input/input.styles.js +1 -1
- package/esm/modal/modal.styles.js +1 -1
- package/esm/pagination/pagination.styles.js +1 -1
- package/esm/popover/popover-content.js +1 -1
- package/esm/popover/popover-trigger.js +1 -1
- package/esm/popover/popover.js +1 -1
- package/esm/popover/popover.styles.js +1 -1
- package/esm/popover/use-popover.js +1 -1
- package/esm/popover/utils.js +1 -1
- package/esm/radio/index.js +1 -1
- package/esm/radio/radio-context.js +1 -1
- package/esm/radio/radio-group.js +1 -1
- package/esm/radio/radio.js +1 -1
- package/esm/radio/radio.styles.js +1 -1
- package/esm/radio/use-radio-group.js +1 -0
- package/esm/radio/use-radio.js +1 -0
- package/esm/snippet/snippet.styles.js +1 -1
- package/esm/switch/switch.styles.js +1 -1
- package/esm/table/table.styles.js +1 -1
- package/esm/theme/colors/gray.js +1 -1
- package/esm/theme/common.js +1 -1
- package/esm/theme/dark-theme.js +1 -1
- package/esm/theme/light-theme.js +1 -1
- package/esm/theme/shared-css.js +1 -0
- package/esm/theme/stitches.config.js +1 -1
- package/esm/tooltip/tooltip.styles.js +1 -1
- package/esm/user/index.js +1 -1
- package/esm/user/user-link.js +1 -1
- package/esm/user/user.js +1 -1
- package/esm/user/user.styles.js +1 -1
- package/esm/utils/checkmark.js +1 -0
- package/esm/utils/color.js +1 -1
- package/esm/utils/dom.js +1 -1
- package/esm/utils/icons.js +1 -1
- package/esm/utils/prop-types.js +1 -1
- package/package.json +6 -1
- package/types/avatar/avatar-group.styles.d.ts +150 -6
- package/types/avatar/avatar.d.ts +2372 -11
- package/types/avatar/avatar.styles.d.ts +2447 -14
- package/types/backdrop/backdrop.styles.d.ts +225 -9
- package/types/button/button-group.styles.d.ts +75 -3
- package/types/button/button-icon.d.ts +79 -5
- package/types/button/button.d.ts +5 -3
- package/types/button/button.styles.d.ts +1249 -7
- package/types/card/card.d.ts +8 -9
- package/types/card/card.styles.d.ts +2621 -24
- package/types/card/use-card.d.ts +301 -0
- package/types/checkbox/checkbox.styles.d.ts +751 -31
- package/types/checkbox/use-checkbox-group.d.ts +3 -2
- package/types/code/code.styles.d.ts +150 -6
- package/types/col/col.styles.d.ts +75 -3
- package/types/collapse/collapse.styles.d.ts +450 -18
- package/types/container/container.styles.d.ts +75 -3
- package/types/divider/divider.styles.d.ts +150 -6
- package/types/dropdown/base/dropdown-item-base.d.ts +19 -0
- package/types/dropdown/dropdown-button.d.ts +3689 -0
- package/types/dropdown/dropdown-context.d.ts +728 -0
- package/types/dropdown/dropdown-icon.d.ts +9 -0
- package/types/dropdown/dropdown-item.d.ts +31 -0
- package/types/dropdown/dropdown-menu.d.ts +30 -0
- package/types/dropdown/dropdown-section.d.ts +29 -0
- package/types/dropdown/dropdown-trigger.d.ts +11 -0
- package/types/dropdown/dropdown-types.d.ts +24 -0
- package/types/dropdown/dropdown.d.ts +24 -0
- package/types/dropdown/dropdown.styles.d.ts +11869 -0
- package/types/dropdown/index.d.ts +9 -0
- package/types/dropdown/use-dropdown.d.ts +389 -0
- package/types/grid/grid.styles.d.ts +150 -6
- package/types/image/image.d.ts +5 -18
- package/types/image/image.styles.d.ts +225 -9
- package/types/index.d.ts +4 -1
- package/types/input/input-password.d.ts +1 -1
- package/types/input/input-props.d.ts +2 -2
- package/types/input/input.styles.d.ts +825 -33
- package/types/link/link.styles.d.ts +150 -6
- package/types/loading/loading.styles.d.ts +450 -18
- package/types/modal/modal.styles.d.ts +450 -18
- package/types/pagination/pagination.styles.d.ts +450 -18
- package/types/popover/popover-content.d.ts +1147 -2
- package/types/popover/popover-context.d.ts +120 -0
- package/types/popover/popover.d.ts +4 -4
- package/types/popover/popover.styles.d.ts +1279 -7
- package/types/popover/use-popover.d.ts +83 -4
- package/types/popover/utils.d.ts +3 -1
- package/types/progress/progress.d.ts +1 -1
- package/types/progress/progress.styles.d.ts +150 -6
- package/types/radio/index.d.ts +2 -2
- package/types/radio/radio-context.d.ts +22 -13
- package/types/radio/radio-group.d.ts +9 -78
- package/types/radio/radio.d.ts +10 -66
- package/types/radio/radio.styles.d.ts +2574 -35
- package/types/radio/use-radio-group.d.ts +26 -0
- package/types/radio/use-radio.d.ts +31 -0
- package/types/row/row.styles.d.ts +75 -3
- package/types/snippet/snippet.styles.d.ts +300 -12
- package/types/spacer/spacer.styles.d.ts +75 -3
- package/types/switch/switch.d.ts +1 -1
- package/types/switch/switch.styles.d.ts +300 -12
- package/types/table/table-column-header.d.ts +75 -3
- package/types/table/table-sort-icon.d.ts +75 -3
- package/types/table/table.styles.d.ts +1278 -52
- package/types/text/text.styles.d.ts +75 -3
- package/types/textarea/textarea.d.ts +1 -1
- package/types/theme/common.d.ts +127 -6
- package/types/theme/dark-theme.d.ts +11 -0
- package/types/theme/light-theme.d.ts +7 -0
- package/types/theme/shared-css.d.ts +5237 -0
- package/types/theme/stitches.config.d.ts +643 -2964
- package/types/theme/types.d.ts +3 -0
- package/types/tooltip/tooltip.d.ts +1 -1
- package/types/tooltip/tooltip.styles.d.ts +300 -12
- package/types/user/index.d.ts +1 -1
- package/types/user/user-link.d.ts +4 -11
- package/types/user/user.styles.d.ts +298 -983
- package/types/utils/checkmark.d.ts +19 -0
- package/types/utils/color.d.ts +1 -0
- package/types/utils/dom.d.ts +5 -2
- package/types/utils/drip.d.ts +76 -4
- package/types/utils/prop-types.d.ts +4 -0
- package/umd/nextui.js +6269 -3172
- package/umd/nextui.min.js +1 -1
package/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./utils/prop-types";export{default as useCurrentState}from"./use-current-state";export{default as useRealShape}from"./use-real-shape";export{default as useResize}from"./use-resize";export{default as useTheme}from"./use-theme";export{default as usePortal}from"./use-portal";export{default as useSSR}from"./use-ssr";export{default as useBodyScroll}from"./use-body-scroll";export{default as useClickAway}from"./use-click-away";export{default as useClipboard}from"./use-clipboard";export{default as useClickAnywhere}from"./use-click-anywhere";export{default as useInput}from"./use-input";export{default as useKeyboard}from"./use-keyboard";export{default as usePagination}from"./use-pagination";export{default as useDrip}from"./use-drip";export{default as Drip}from"./utils/drip";export{KeyMod,KeyCode}from"./use-keyboard/codes";export{default as CssBaseline}from"./css-baseline";export{useAsyncList}from"@react-stately/data";export{useCollator}from"@react-aria/i18n";export{default as NextUIProvider}from"./theme/theme-provider";export{changeTheme,getDocumentTheme,getTokenValue}from"./theme/utils";export{styled,css,theme,createTheme,getCssText,globalCss,keyframes,config,config as stitchesConfig,theme as defaultTheme
|
|
1
|
+
export*from"./utils/prop-types";export{default as useCurrentState}from"./use-current-state";export{default as useRealShape}from"./use-real-shape";export{default as useResize}from"./use-resize";export{default as useTheme}from"./use-theme";export{default as usePortal}from"./use-portal";export{default as useSSR}from"./use-ssr";export{default as useBodyScroll}from"./use-body-scroll";export{default as useClickAway}from"./use-click-away";export{default as useClipboard}from"./use-clipboard";export{default as useClickAnywhere}from"./use-click-anywhere";export{default as useInput}from"./use-input";export{default as useKeyboard}from"./use-keyboard";export{default as usePagination}from"./use-pagination";export{default as useDrip}from"./use-drip";export{default as Drip}from"./utils/drip";export{KeyMod,KeyCode}from"./use-keyboard/codes";export{default as CssBaseline}from"./css-baseline";export{useAsyncList}from"@react-stately/data";export{useCollator}from"@react-aria/i18n";export{default as NextUIProvider}from"./theme/theme-provider";export{changeTheme,getDocumentTheme,getTokenValue}from"./theme/utils";export{styled,css,theme,createTheme,getCssText,globalCss,keyframes,config,config as stitchesConfig,theme as defaultTheme}from"./theme/stitches.config";export*from"./theme/shared-css";export*from"./theme/colors";export{default as Avatar}from"./avatar";export*from"./avatar";export{default as Button}from"./button";export*from"./button";export{default as Card}from"./card";export*from"./card";export{default as Checkbox}from"./checkbox";export*from"./checkbox";export{default as Code}from"./code";export*from"./code";export{default as Col}from"./col";export*from"./col";export{default as Collapse}from"./collapse";export*from"./collapse";export{default as Container}from"./container";export*from"./container";export{default as Divider}from"./divider";export*from"./divider";export{default as Grid}from"./grid";export*from"./grid";export{default as Image}from"./image";export*from"./image";export{default as Spacer}from"./spacer";export*from"./spacer";export{default as Snippet}from"./snippet";export*from"./snippet";export{default as Row}from"./row";export*from"./row";export{default as Link}from"./link";export*from"./link";export{default as Loading}from"./loading";export*from"./loading";export{default as Radio}from"./radio";export*from"./radio";export{default as Text}from"./text";export*from"./text";export{default as Switch}from"./switch";export*from"./switch";export{default as Backdrop}from"./backdrop";export*from"./backdrop";export{default as User}from"./user";export*from"./user";export{default as Progress}from"./progress";export*from"./progress";export{default as Modal}from"./modal";export*from"./modal";export{default as useModal}from"./modal/use-modal";export{default as Pagination}from"./pagination";export*from"./pagination";export{default as Tooltip}from"./tooltip";export*from"./tooltip";export{default as Input}from"./input";export*from"./input";export{default as Textarea}from"./textarea";export{default as Table}from"./table";export*from"./table";export{default as Popover}from"./popover";export*from"./popover";export{default as Dropdown}from"./dropdown";export*from"./dropdown";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{styled as e,sharedVisuallyHidden as o}from"../theme/stitches.config";export const StyledInputMainContainer=e("div",{$$inputColor:"$colors$accents0",$$inputTextColor:"$colors$text",$$inputPlaceholderColor:"$colors$accents6",$$inputShadow:"$shadows$sm",$$inputBorderColor:"$colors$border",$$inputHoverBorderColor:"$colors$foreground",$$inputLabelColor:"$$inputHoverBorderColor",display:"inline-flex",flexDirection:"column",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitBoxAlign:"center",variants:{color:{default:{},primary:{$$inputHoverBorderColor:"$colors$primary",$$inputLabelColor:"$colors$primary"},secondary:{$$inputHoverBorderColor:"$colors$secondary",$$inputLabelColor:"$colors$secondary"},success:{$$inputHoverBorderColor:"$colors$success",$$inputLabelColor:"$colors$success"},warning:{$$inputHoverBorderColor:"$colors$warning",$$inputLabelColor:"$colors$warning"},error:{$$inputHoverBorderColor:"$colors$error",$$inputLabelColor:"$colors$error"}},status:{default:{},primary:{$$inputColor:"$colors$primaryLight",$$inputPlaceholderColor:"$colors$primaryLightContrast",$$inputTextColor:"$colors$primaryLightContrast",$$inputLabelColor:"$$inputTextColor",$$inputHoverBorderColor:"$colors$primary"},secondary:{$$inputColor:"$colors$secondaryLight",$$inputPlaceholderColor:"$colors$secondaryLightContrast",$$inputTextColor:"$colors$secondaryLightContrast",$$inputLabelColor:"$$inputTextColor",$$inputHoverBorderColor:"$colors$secondary"},success:{$$inputColor:"$colors$successLight",$$inputPlaceholderColor:"$colors$successLightContrast",$$inputTextColor:"$colors$successLightContrast",$$inputLabelColor:"$$inputTextColor",$$inputHoverBorderColor:"$colors$success"},warning:{$$inputColor:"$colors$warningLight",$$inputPlaceholderColor:"$colors$warningLightContrast",$$inputTextColor:"$colors$warningLightContrast",$$inputLabelColor:"$$inputTextColor",$$inputHoverBorderColor:"$colors$warning"},error:{$$inputColor:"$colors$errorLight",$$inputPlaceholderColor:"$colors$errorLightContrast",$$inputTextColor:"$colors$errorLightContrast",$$inputLabelColor:"$$inputTextColor",$$inputHoverBorderColor:"$colors$error"}},helperColor:{default:{$$inputHelperColor:"$colors$text"},primary:{$$inputHelperColor:"$colors$primary"},secondary:{$$inputHelperColor:"$colors$secondary"},success:{$$inputHelperColor:"$colors$success"},warning:{$$inputHelperColor:"$colors$warning"},error:{$$inputHelperColor:"$colors$error"}},borderWeight:{light:{$$inputBorderWeight:"$borderWeights$light"},normal:{$$inputBorderWeight:"$borderWeights$normal"},bold:{$$inputBorderWeight:"$borderWeights$bold"},extrabold:{$$inputBorderWeight:"$borderWeights$extrabold"},black:{$$inputBorderWeight:"$borderWeights$black"}},size:{xs:{$$inputBorderRadius:"$space$3",$$inputFontSize:"$fontSizes$tiny",$$inputHeightRatio:"1.2",br:"$$inputBorderRadius"},sm:{$$inputBorderRadius:"$space$4",$$inputFontSize:"$fontSizes$tiny",$$inputHeightRatio:"1.6",br:"$$inputBorderRadius"},md:{$$inputBorderRadius:"$space$6",$$inputFontSize:"$fontSizes$xs",$$inputHeightRatio:"2",br:"$$inputBorderRadius"},lg:{$$inputBorderRadius:"$space$7",$$inputFontSize:"$fontSizes$base",$$inputHeightRatio:"2.2",br:"$$inputBorderRadius"},xl:{$$inputBorderRadius:"$space$8",$$inputFontSize:"$fontSizes$sm",$$inputHeightRatio:"2.6",br:"$$inputBorderRadius"}},rounded:{true:{$$inputBorderRadius:"$radii$pill"}},disabled:{true:{$$inputColor:"$colors$accents1",$$inputTextColor:"$colors$accents7",$$inputPlaceholderColor:"$colors$accents7",$$inputShadow:"$shadows$sm"}}}});export const StyledInputContainer=e("div",{width:"100%",br:"$$inputBorderRadius","@motion":{transition:"none"},variants:{isTextarea:{false:{display:"inline-flex",alignItems:"center",height:"calc($$inputHeightRatio * $9)"}},focused:{true:{}},isReadOnly:{false:{}},underlined:{true:{}},animated:{true:{transition:"$default"},false:{transition:"none"}}},compoundVariants:[{isReadOnly:!1,underlined:!0,css:{transform:"none"}},{focused:!0,animated:!0,isReadOnly:!1,underlined:!1,css:{transform:"translateY(-$space$1)"}}]});export const StyledInput=e("input",{padding:0,fontSize:"$$inputFontSize",bg:"transparent",border:"none",color:"$$inputTextColor",br:0,outline:"none",size:"100%",minWidth:0,WebkitAppearance:"none","::placeholder":{color:"$$inputPlaceholderColor",transition:"opacity 0.25s ease 0s",MozTransition:"opacity 0.25s ease 0s",MsTransition:"opacity 0.25s ease 0s",WebkitTransition:"opacity 0.25s ease 0s"},"@motion":{transition:"none","&::placeholder":{transition:"none"}},"&:disabled":{pe:"none",color:"$accents4",cursor:"not-allowed"},variants:{isTextarea:{true:{boxShadow:"none",display:"block",size:"100%",resize:"none",border:"none",outline:"none"}},focused:{true:{"&::placeholder":{opacity:0,transition:"opacity 0.25s ease 0s"}}},bordered:{true:{padding:"0 $3"}},rounded:{true:{padding:"0 $3"}},animated:{false:{transition:"none","::placeholder":{transition:"none"}}},hasLeftContent:{true:{ml:0}},hasRightContent:{true:{mr:0}}}});export const StyledInputWrapper=e("div",{flex:1,position:"relative",br:"$$inputBorderRadius",bg:"$$inputColor",display:"inline-flex",verticalAlign:"middle",alignItems:"center",userSelect:"none","@motion":{transition:"none","&:before":{transition:"none"},"&:after":{transition:"none"}},variants:{focused:{true:{}},isReadOnly:{true:{}},bordered:{true:{bg:"transparent",border:"none",boxShadow:"0 0 0 $$inputBorderWeight $$inputBorderColor",transition:"box-shadow 0.25s ease"}},shadow:{true:{transition:"$default"}},disabled:{true:{cursor:"not-allowed"}},underlined:{true:{bg:"transparent",[`& ${StyledInput}`]:{margin:"$2 $3"},"&:before":{content:"",position:"absolute",zIndex:"$2",width:0,bottom:0,height:"$1",left:"50%",transform:"translate(-50%)",background:"$$inputHoverBorderColor",transition:"width 0.25s ease"},"&:after":{content:"",position:"absolute",zIndex:"$1",bottom:0,width:"100%",height:"$$inputBorderWeight",bg:"$$inputBorderColor"}},false:{[`& ${StyledInput}`]:{margin:"$2 $5"}}},animated:{false:{transition:"none","&:before":{transition:"none"},"&:after":{transition:"none"}}},isTextarea:{true:{boxSizing:"border-box",width:"100%",maxWidth:"100%",height:"auto"},false:{height:"100%"}}},compoundVariants:[{bordered:!0,underlined:!0,css:{boxShadow:"0 0 0 0px $$inputBorderColor"}},{focused:!0,underlined:!0,css:{"&:before":{width:"100%"}}},{focused:!0,shadow:!0,isReadOnly:!1,underlined:!1,css:{boxShadow:"$$inputShadow"}},{focused:!0,bordered:!0,isReadOnly:!1,underlined:!1,css:{boxShadow:"0 0 0 $$inputBorderWeight $$inputHoverBorderColor"}},{bordered:!0,isReadOnly:!1,underlined:!1,css:{"&:hover":{boxShadow:"0 0 0 $$inputBorderWeight $$inputHoverBorderColor"}}},{isTextarea:!0,underlined:!1,css:{[`& ${StyledInput}`]:{margin:"$xs $sm"}}}]});export const StyledHelperTextContainer=e("div",{position:"absolute",opacity:0,bottom:"calc($$inputHeightRatio * -$space$5)","@motion":{transition:"none"},variants:{animated:{true:{transition:"opacity 0.25s ease"},false:{transition:"none"}},withValue:{true:{opacity:1}}}});export const StyledHelperText=e("p",{margin:"$1 0 0 $5",fontSize:"$space$5",color:"$$inputHelperColor"});export const StyledInputPlaceholder=e("span",{},o);export const StyledInputBlockLabel=e("label",{d:"block",fontWeight:"$normal",color:"$$inputLabelColor",p:"0 0 0 $2",mb:"$3",fs:"$$inputFontSize",lh:"$md",WebkitTouchCallout:"none",WebkitUserSelect:"none",KhtmlUserSelect:"none",MozUserSelect:"none",MsUserSelect:"none",us:"none","> *:first-child":{marginTop:0},"> *:last-child":{mb:0},"@motion":{transition:"none"},variants:{rounded:{true:{padding:"0 0 0 $3"}},asPlaceholder:{true:{position:"absolute",padding:0,zIndex:"$1",left:"$space$6",top:"20%",mb:0,cursor:"text",color:"$$inputPlaceholderColor",transition:"left 0.25s ease 0s, color 0.25s ease 0s, top 0.25s ease 0s"}},animated:{false:{transition:"none"}},focused:{true:{color:"$$inputHoverBorderColor"}},underlined:{true:{}},withValue:{true:{}},isTextarea:{true:{}},bordered:{true:{}},hasContentLeft:{true:{}}},compoundVariants:[{underlined:!0,asPlaceholder:!0,css:{left:"$space$2"}},{asPlaceholder:!0,focused:!0,underlined:!1,isTextarea:!1,css:{top:"-72%",left:"$2",cursor:"inherit"}},{asPlaceholder:!0,focused:!0,underlined:!0,isTextarea:!1,css:{top:"-72%",left:"0px",cursor:"inherit"}},{asPlaceholder:!0,withValue:!0,underlined:!1,isTextarea:!1,css:{color:"$$inputTextColor",top:"-72%",left:"$2",cursor:"inherit"}},{asPlaceholder:!0,withValue:!0,underlined:!0,isTextarea:!1,css:{color:"$$inputTextColor",top:"-72%",left:"0px",cursor:"inherit"}},{asPlaceholder:!0,isTextarea:!0,css:{top:"$5"}},{asPlaceholder:!0,hasContentLeft:!0,css:{left:"calc($space$6 + $$inputHeightRatio * $space$7)"}},{asPlaceholder:!0,isTextarea:!0,focused:!0,css:{top:"calc(-$space$10 - $space$3)",left:"$2"}},{asPlaceholder:!0,isTextarea:!0,withValue:!0,css:{top:"-$11"}},{asPlaceholder:!0,focused:!0,isTextarea:!0,bordered:!0,css:{top:"-$12"}}],defaultVariants:{asPlaceholder:!1}});export const StyledInputLabel=e("span",{position:"relative",display:"inline-flex",width:"initial",height:"100%",fontWeight:"$medium",ai:"center",pe:"none",margin:0,padding:"0 $sm",color:"$$inputPlaceholderColor",fontSize:"$$inputFontSize",lineHeight:"$xs",variants:{isRight:{true:{btrr:"$$inputBorderRadius",bbrr:"$$inputBorderRadius"},false:{btlr:"$$inputBorderRadius",bblr:"$$inputBorderRadius"}},isDark:{true:{}},isDefaultStatus:{true:{}},underlined:{true:{bg:"transparent"}},bordered:{true:{"&:after":{display:"none"},"&:before":{display:"none"}}}},compoundVariants:[{isRight:!0,underlined:!0,css:{borderLeftColor:"$$inputPlaceholderColor",borderLeftStyle:"solid",marginLeft:"$2",borderLeftWidth:"calc($$inputBorderWeight / 2)",height:"40%"}},{isRight:!1,underlined:!0,css:{borderRightColor:"$$inputPlaceholderColor",borderRightStyle:"solid",marginRight:"$2",borderRightWidth:"calc($$inputBorderWeight / 1)",height:"40%"}},{isDefaultStatus:!0,bordered:!1,underlined:!1,css:{bg:"$accents2"}},{isDefaultStatus:!0,bordered:!1,underlined:!1,isDark:!0,css:{color:"$accents6"}},{isDefaultStatus:!1,bordered:!0,underlined:!1,css:{bg:"$$inputColor"}},{bordered:!0,isRight:!0,css:{peddingRight:"$sm",paddingLeft:0}},{bordered:!0,isRight:!1,css:{peddingLeft:"$sm",paddingRight:0}}],defaultVariants:{isRight:!1}});export const StyledInputContent=e("span",{variants:{applyStyles:{true:{display:"flex",boxSizing:"content-box",width:"calc($$inputHeightRatio * $space$4)",height:"100%",alignItems:"center",verticalAlign:"center",margin:0,padding:"0 calc($$inputHeightRatio * $3)",color:"$$inputTextColor",lineHeight:"$xs",position:"relative",cursor:"default",pe:"none"}},clickable:{true:{cursor:"pointer",pe:"auto"}}}});export const StyledInputClearButton=e("button",{position:"absolute",right:0,margin:0,d:"inline-flex",ai:"center",border:"none",bg:"transparent",width:"auto",height:"auto",cursor:"pointer",boxSizing:"border-box",transition:"color 250ms ease 0s, transform 250ms ease 0s, opacity 250ms ease 0s",color:"$$inputPlaceholderColor",visibility:"hidden",transform:"translateX(20%)",opacity:0,"&:hover":{opacity:.85},svg:{color:"currentColor",size:"calc($space$5 * $$inputHeightRatio)"},"@motion":{transition:"none"},variants:{visible:{true:{visibility:"visible",transform:"translateX(0)",opacity:1}},underlined:{true:{padding:"0 $1"}},animated:{false:{transition:"none"}},hasContentRight:{true:{padding:0,position:"relative",transform:"translateX(30%)"}},disabled:{true:{cursor:"not-allowed","&:hover":{color:"$accents3"}}}}});
|
|
1
|
+
import{styled as e}from"../theme/stitches.config";import{sharedVisuallyHidden as o}from"../theme/shared-css";export const StyledInputMainContainer=e("div",{$$inputColor:"$colors$accents0",$$inputTextColor:"$colors$text",$$inputPlaceholderColor:"$colors$accents6",$$inputShadow:"$shadows$sm",$$inputBorderColor:"$colors$border",$$inputHoverBorderColor:"$colors$foreground",$$inputLabelColor:"$$inputHoverBorderColor",display:"inline-flex",flexDirection:"column",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitBoxAlign:"center",variants:{color:{default:{},primary:{$$inputHoverBorderColor:"$colors$primary",$$inputLabelColor:"$colors$primary"},secondary:{$$inputHoverBorderColor:"$colors$secondary",$$inputLabelColor:"$colors$secondary"},success:{$$inputHoverBorderColor:"$colors$success",$$inputLabelColor:"$colors$success"},warning:{$$inputHoverBorderColor:"$colors$warning",$$inputLabelColor:"$colors$warning"},error:{$$inputHoverBorderColor:"$colors$error",$$inputLabelColor:"$colors$error"}},status:{default:{},primary:{$$inputColor:"$colors$primaryLight",$$inputPlaceholderColor:"$colors$primaryLightContrast",$$inputTextColor:"$colors$primaryLightContrast",$$inputLabelColor:"$$inputTextColor",$$inputHoverBorderColor:"$colors$primary"},secondary:{$$inputColor:"$colors$secondaryLight",$$inputPlaceholderColor:"$colors$secondaryLightContrast",$$inputTextColor:"$colors$secondaryLightContrast",$$inputLabelColor:"$$inputTextColor",$$inputHoverBorderColor:"$colors$secondary"},success:{$$inputColor:"$colors$successLight",$$inputPlaceholderColor:"$colors$successLightContrast",$$inputTextColor:"$colors$successLightContrast",$$inputLabelColor:"$$inputTextColor",$$inputHoverBorderColor:"$colors$success"},warning:{$$inputColor:"$colors$warningLight",$$inputPlaceholderColor:"$colors$warningLightContrast",$$inputTextColor:"$colors$warningLightContrast",$$inputLabelColor:"$$inputTextColor",$$inputHoverBorderColor:"$colors$warning"},error:{$$inputColor:"$colors$errorLight",$$inputPlaceholderColor:"$colors$errorLightContrast",$$inputTextColor:"$colors$errorLightContrast",$$inputLabelColor:"$$inputTextColor",$$inputHoverBorderColor:"$colors$error"}},helperColor:{default:{$$inputHelperColor:"$colors$text"},primary:{$$inputHelperColor:"$colors$primary"},secondary:{$$inputHelperColor:"$colors$secondary"},success:{$$inputHelperColor:"$colors$success"},warning:{$$inputHelperColor:"$colors$warning"},error:{$$inputHelperColor:"$colors$error"}},borderWeight:{light:{$$inputBorderWeight:"$borderWeights$light"},normal:{$$inputBorderWeight:"$borderWeights$normal"},bold:{$$inputBorderWeight:"$borderWeights$bold"},extrabold:{$$inputBorderWeight:"$borderWeights$extrabold"},black:{$$inputBorderWeight:"$borderWeights$black"}},size:{xs:{$$inputBorderRadius:"$space$3",$$inputFontSize:"$fontSizes$xs",$$inputHeightRatio:"1.2",br:"$$inputBorderRadius"},sm:{$$inputBorderRadius:"$space$4",$$inputFontSize:"$fontSizes$xs",$$inputHeightRatio:"1.6",br:"$$inputBorderRadius"},md:{$$inputBorderRadius:"$space$6",$$inputFontSize:"$fontSizes$sm",$$inputHeightRatio:"2",br:"$$inputBorderRadius"},lg:{$$inputBorderRadius:"$space$7",$$inputFontSize:"$fontSizes$md",$$inputHeightRatio:"2.2",br:"$$inputBorderRadius"},xl:{$$inputBorderRadius:"$space$8",$$inputFontSize:"$fontSizes$lg",$$inputHeightRatio:"2.6",br:"$$inputBorderRadius"}},rounded:{true:{$$inputBorderRadius:"$radii$pill"}},disabled:{true:{$$inputColor:"$colors$accents1",$$inputTextColor:"$colors$accents7",$$inputPlaceholderColor:"$colors$accents7",$$inputShadow:"$shadows$sm"}}}});export const StyledInputContainer=e("div",{width:"100%",br:"$$inputBorderRadius","@motion":{transition:"none"},variants:{isTextarea:{false:{display:"inline-flex",alignItems:"center",height:"calc($$inputHeightRatio * $9)"}},focused:{true:{}},isReadOnly:{false:{}},underlined:{true:{}},animated:{true:{transition:"$default"},false:{transition:"none"}}},compoundVariants:[{isReadOnly:!1,underlined:!0,css:{transform:"none"}},{focused:!0,animated:!0,isReadOnly:!1,underlined:!1,css:{transform:"translateY(-$space$1)"}}]});export const StyledInput=e("input",{padding:0,fontSize:"$$inputFontSize",bg:"transparent",border:"none",color:"$$inputTextColor",br:0,outline:"none",size:"100%",minWidth:0,WebkitAppearance:"none","::placeholder":{color:"$$inputPlaceholderColor",transition:"opacity 0.25s ease 0s",MozTransition:"opacity 0.25s ease 0s",MsTransition:"opacity 0.25s ease 0s",WebkitTransition:"opacity 0.25s ease 0s"},"@motion":{transition:"none","&::placeholder":{transition:"none"}},"&:disabled":{pe:"none",color:"$accents4",cursor:"not-allowed"},variants:{isTextarea:{true:{boxShadow:"none",display:"block",size:"100%",resize:"none",border:"none",outline:"none"}},focused:{true:{"&::placeholder":{opacity:0,transition:"opacity 0.25s ease 0s"}}},bordered:{true:{padding:"0 $3"}},rounded:{true:{padding:"0 $3"}},animated:{false:{transition:"none","::placeholder":{transition:"none"}}},hasLeftContent:{true:{ml:0}},hasRightContent:{true:{mr:0}}}});export const StyledInputWrapper=e("div",{flex:1,position:"relative",br:"$$inputBorderRadius",bg:"$$inputColor",display:"inline-flex",verticalAlign:"middle",alignItems:"center",userSelect:"none","@motion":{transition:"none","&:before":{transition:"none"},"&:after":{transition:"none"}},variants:{focused:{true:{}},isReadOnly:{true:{}},bordered:{true:{bg:"transparent",border:"none",boxShadow:"0 0 0 $$inputBorderWeight $$inputBorderColor",transition:"box-shadow 0.25s ease"}},shadow:{true:{transition:"$default"}},disabled:{true:{cursor:"not-allowed"}},underlined:{true:{bg:"transparent",[`& ${StyledInput}`]:{margin:"$2 $3"},"&:before":{content:"",position:"absolute",zIndex:"$2",width:0,bottom:0,height:"$1",left:"50%",transform:"translate(-50%)",background:"$$inputHoverBorderColor",transition:"width 0.25s ease"},"&:after":{content:"",position:"absolute",zIndex:"$1",bottom:0,width:"100%",height:"$$inputBorderWeight",bg:"$$inputBorderColor"}},false:{[`& ${StyledInput}`]:{margin:"$2 $5"}}},animated:{false:{transition:"none","&:before":{transition:"none"},"&:after":{transition:"none"}}},isTextarea:{true:{boxSizing:"border-box",width:"100%",maxWidth:"100%",height:"auto"},false:{height:"100%"}}},compoundVariants:[{bordered:!0,underlined:!0,css:{boxShadow:"0 0 0 0px $$inputBorderColor"}},{focused:!0,underlined:!0,css:{"&:before":{width:"100%"}}},{focused:!0,shadow:!0,isReadOnly:!1,underlined:!1,css:{boxShadow:"$$inputShadow"}},{focused:!0,bordered:!0,isReadOnly:!1,underlined:!1,css:{boxShadow:"0 0 0 $$inputBorderWeight $$inputHoverBorderColor"}},{bordered:!0,isReadOnly:!1,underlined:!1,css:{"&:hover":{boxShadow:"0 0 0 $$inputBorderWeight $$inputHoverBorderColor"}}},{isTextarea:!0,underlined:!1,css:{[`& ${StyledInput}`]:{margin:"$xs $sm"}}}]});export const StyledHelperTextContainer=e("div",{position:"absolute",opacity:0,bottom:"calc($$inputHeightRatio * -$space$5)","@motion":{transition:"none"},variants:{animated:{true:{transition:"opacity 0.25s ease"},false:{transition:"none"}},withValue:{true:{opacity:1}}}});export const StyledHelperText=e("p",{margin:"$1 0 0 $5",fontSize:"$space$5",color:"$$inputHelperColor"});export const StyledInputPlaceholder=e("span",{},o);export const StyledInputBlockLabel=e("label",{d:"block",fontWeight:"$normal",color:"$$inputLabelColor",p:"0 0 0 $2",mb:"$3",fs:"$$inputFontSize",lh:"$md",WebkitTouchCallout:"none",WebkitUserSelect:"none",KhtmlUserSelect:"none",MozUserSelect:"none",MsUserSelect:"none",us:"none","> *:first-child":{marginTop:0},"> *:last-child":{mb:0},"@motion":{transition:"none"},variants:{rounded:{true:{padding:"0 0 0 $3"}},asPlaceholder:{true:{position:"absolute",padding:0,zIndex:"$1",left:"$space$6",top:"20%",mb:0,cursor:"text",color:"$$inputPlaceholderColor",transition:"left 0.25s ease 0s, color 0.25s ease 0s, top 0.25s ease 0s"}},animated:{false:{transition:"none"}},focused:{true:{color:"$$inputHoverBorderColor"}},underlined:{true:{}},withValue:{true:{}},isTextarea:{true:{}},bordered:{true:{}},hasContentLeft:{true:{}}},compoundVariants:[{underlined:!0,asPlaceholder:!0,css:{left:"$space$2"}},{asPlaceholder:!0,focused:!0,underlined:!1,isTextarea:!1,css:{top:"-72%",left:"$2",cursor:"inherit"}},{asPlaceholder:!0,focused:!0,underlined:!0,isTextarea:!1,css:{top:"-72%",left:"0px",cursor:"inherit"}},{asPlaceholder:!0,withValue:!0,underlined:!1,isTextarea:!1,css:{color:"$$inputTextColor",top:"-72%",left:"$2",cursor:"inherit"}},{asPlaceholder:!0,withValue:!0,underlined:!0,isTextarea:!1,css:{color:"$$inputTextColor",top:"-72%",left:"0px",cursor:"inherit"}},{asPlaceholder:!0,isTextarea:!0,css:{top:"$5"}},{asPlaceholder:!0,hasContentLeft:!0,css:{left:"calc($space$6 + $$inputHeightRatio * $space$7)"}},{asPlaceholder:!0,isTextarea:!0,focused:!0,css:{top:"calc(-$space$10 - $space$3)",left:"$2"}},{asPlaceholder:!0,isTextarea:!0,withValue:!0,css:{top:"-$11"}},{asPlaceholder:!0,focused:!0,isTextarea:!0,bordered:!0,css:{top:"-$12"}}],defaultVariants:{asPlaceholder:!1}});export const StyledInputLabel=e("span",{position:"relative",display:"inline-flex",width:"initial",height:"100%",fontWeight:"$medium",ai:"center",pe:"none",margin:0,padding:"0 $sm",color:"$$inputPlaceholderColor",fontSize:"$$inputFontSize",lineHeight:"$xs",variants:{isRight:{true:{btrr:"$$inputBorderRadius",bbrr:"$$inputBorderRadius"},false:{btlr:"$$inputBorderRadius",bblr:"$$inputBorderRadius"}},isDark:{true:{}},isDefaultStatus:{true:{}},underlined:{true:{bg:"transparent"}},bordered:{true:{"&:after":{display:"none"},"&:before":{display:"none"}}}},compoundVariants:[{isRight:!0,underlined:!0,css:{borderLeftColor:"$$inputPlaceholderColor",borderLeftStyle:"solid",marginLeft:"$2",borderLeftWidth:"calc($$inputBorderWeight / 2)",height:"40%"}},{isRight:!1,underlined:!0,css:{borderRightColor:"$$inputPlaceholderColor",borderRightStyle:"solid",marginRight:"$2",borderRightWidth:"calc($$inputBorderWeight / 1)",height:"40%"}},{isDefaultStatus:!0,bordered:!1,underlined:!1,css:{bg:"$accents2"}},{isDefaultStatus:!0,bordered:!1,underlined:!1,isDark:!0,css:{color:"$accents6"}},{isDefaultStatus:!1,bordered:!0,underlined:!1,css:{bg:"$$inputColor"}},{bordered:!0,isRight:!0,css:{peddingRight:"$sm",paddingLeft:0}},{bordered:!0,isRight:!1,css:{peddingLeft:"$sm",paddingRight:0}}],defaultVariants:{isRight:!1}});export const StyledInputContent=e("span",{variants:{applyStyles:{true:{display:"flex",boxSizing:"content-box",width:"calc($$inputHeightRatio * $space$4)",height:"100%",alignItems:"center",verticalAlign:"center",margin:0,padding:"0 calc($$inputHeightRatio * $3)",color:"$$inputTextColor",lineHeight:"$xs",position:"relative",cursor:"default",pe:"none"}},clickable:{true:{cursor:"pointer",pe:"auto"}}}});export const StyledInputClearButton=e("button",{position:"absolute",right:0,margin:0,d:"inline-flex",ai:"center",border:"none",bg:"transparent",width:"auto",height:"auto",cursor:"pointer",boxSizing:"border-box",transition:"color 250ms ease 0s, transform 250ms ease 0s, opacity 250ms ease 0s",color:"$$inputPlaceholderColor",visibility:"hidden",transform:"translateX(20%)",opacity:0,"&:hover":{opacity:.85},svg:{color:"currentColor",size:"calc($space$5 * $$inputHeightRatio)"},"@motion":{transition:"none"},variants:{visible:{true:{visibility:"visible",transform:"translateX(0)",opacity:1}},underlined:{true:{padding:"0 $1"}},animated:{false:{transition:"none"}},hasContentRight:{true:{padding:0,position:"relative",transform:"translateX(30%)"}},disabled:{true:{cursor:"not-allowed","&:hover":{color:"$accents3"}}}}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{styled as i
|
|
1
|
+
import{styled as i}from"../theme/stitches.config";import{reboundAnimation as o,appearanceIn as e,appearanceOut as t}from"../utils/animations";import{sharedFocus as n}from"../theme/shared-css";export const StyledModalHideTab=i("div",{outline:"none",overflow:"hidden",width:0,height:0,opacity:0});export const StyledModalCloseButton=i("button",{position:"absolute",background:"transparent",border:"none",zIndex:"$1",top:"$space$3",right:"$space$2",margin:0,d:"inline-flex",ai:"center",height:"auto",cursor:"pointer",boxSizing:"border-box",transition:"$default",padding:"calc($space$sm * 0.5)",color:"$accents4",br:"$space$5",svg:{color:"currentColor"},"&:hover":{svg:{opacity:.8}},variants:{disabled:{true:{cursor:"not-allowed"}}}},n);export const StyledModalHeader=i("div",{display:"flex",flexShrink:0,ai:"center",ov:"hidden",color:"inherit",padding:"$sm $10",fs:"$xs",variants:{noPadding:{true:{padding:0}},autoMargin:{true:{"> *:first-child":{mt:0},"> *:last-child":{mb:0}}}}});export const StyledModalBody=i("div",{display:"flex",flexDirection:"column",flex:"1 1 auto",padding:"$sm $10",oy:"auto",position:"relative",ta:"left",variants:{noPadding:{true:{flex:1,padding:0}},autoMargin:{true:{"> *:first-child":{mt:0},"> *":{mb:"$8"},"> *:last-child":{mb:0}}}}});export const StyledModalFooter=i("div",{d:"flex",flexWrap:"wrap",flexShrink:0,overflow:"hidden",color:"inherit",ai:"center",fs:"$xs",padding:"$sm $lg",variants:{noPadding:{true:{padding:0}},autoMargin:{true:{"> *":{m:"$2"}}}}});export const StyledModal=i("section",{maxWidth:"100%",verticalAlign:"middle",overflow:"hidden",height:"fit-content(20em)",maxHeight:"inherit",display:"flex",outline:"none",flexDirection:"column",position:"relative",boxSizing:"border-box",color:"$foreground",br:"$lg",boxShadow:"$lg",bg:"$backgroundContrast",animationFillMode:"forwards","@motion":{transition:"none"},"&.nextui-modal-wrapper-enter:not(.nextui-modal-rendered)":{animationName:e,animationDuration:"200ms",animationTimingFunction:"ease-in",animationDirection:"normal"},"&.nextui-modal-wrapper-leave":{animationName:t,animationDuration:"50ms",animationTimingFunction:"ease-out"},variants:{fullScreen:{true:{size:"100%",maxHeight:"100%"},false:{"&.nextui-modal-rebound":{animationDuration:"250ms",animationName:o,animationTimingFunction:"ease",animationFillMode:"forwards"}}},scroll:{true:{maxHeight:"calc(100vh - 200px)"}},closeButton:{true:{paddingTop:"$lg",[`& ${StyledModalCloseButton}`]:{svg:{size:"$10"}}}}},compoundVariants:[{scroll:!0,fullScreen:!0,css:{maxHeight:"100%"}}]});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{styled as n,
|
|
1
|
+
import{styled as n,keyframes as i}from"../theme/stitches.config";import{sharedFocus as a}from"../theme/shared-css";const o=i({"0%":{transform:"scale(1)"},"60%":{transform:"scale($$paginationScaleTransform)"},"100%":{transform:"scale(1)"}});export const StyledPaginationEllipsis=n("svg",{color:"currentColor",stroke:"currentColor",variants:{isEllipsis:{true:{transform:"0deg"}},isBefore:{true:{}}},compoundVariants:[{isEllipsis:!0,isBefore:!0,css:{transform:"rotate(180deg)"}}]});export const StyledPaginationIcon=n("svg",{transform:"rotate(180deg)",variants:{isPrev:{true:{transform:"rotate(0deg)"}}}});export const StyledPaginationItemContent=n("span",{position:"relative",display:"inline-flex",alignItems:"center",top:0,left:0,zIndex:"$2"});export const StyledPaginationItem=n("button",{border:"none",position:"relative",display:"inline-flex",margin:"0 $$paginationItemMargin",ai:"center",jc:"center",padding:0,boxSizing:"border-box",tt:"capitalize",us:"none",whiteSpace:"nowrap",ta:"center",verticalAlign:"middle",bs:"none",outline:"none",height:"$$paginationSize",minWidth:"$$paginationSize",fs:"inherit",cursor:"pointer",br:"$$paginationItemRadius",color:"$text",bg:"$accents0","@motion":{transition:"none"},"&:hover":{bg:"$accents1"},[`& ${StyledPaginationIcon}`]:{size:"$$paginationFontSize"},[`& ${StyledPaginationEllipsis}`]:{size:"$$paginationFontSize"},variants:{active:{true:{fontWeight:"$bold",cursor:"default",boxShadow:"$sm",[`& ${StyledPaginationItemContent}`]:{color:"$white"}}},disabled:{true:{color:"$accents5",cursor:"not-allowed"}},bordered:{true:{bg:"transparent",border:"$$paginationItemBorderWeight solid $accents2"}},onlyDots:{true:{}},preserveContent:{true:{}},animated:{true:{transition:"transform 0.25s ease 0s, background 0.25s ease 0s, box-shadow 0.25s ease 0s"},false:{transition:"none"}}},compoundVariants:[{onlyDots:!0,preserveContent:!1,css:{[`& ${StyledPaginationItemContent}`]:{display:"none"}}},{animated:!0,disabled:!1,active:!1,css:{"&:active":{transform:"scale($$paginationScaleTransform)",fs:"calc($$paginationFontSize * 0.9)"}}}]},a);export const StyledPaginationHighlight=n("div",{position:"absolute",contain:"strict",top:"0px",zIndex:"$1",bg:"$$paginationColor",br:"$$paginationItemRadius",height:"$$paginationSize",minWidth:"$$paginationSize",animationName:`${o}`,animationDirection:"normal","&.nextui-pagination-highlight--moving":{transform:"scale($$paginationScaleTransform)"},"@motion":{transition:"none","&.nextui-pagination-highlight--moving":{transform:"scale(1)"}},variants:{animated:{true:{animationDuration:"350ms",animationTimingFunction:"ease",transition:"left 350ms ease 0s, transform 300ms ease 0s"},false:{animationDuration:"none",animationTimingFunction:"none",transition:"none","&.nextui-pagination-highlight--moving":{transform:"scale(1)"}}},noMargin:{true:{br:"$squared"}},rounded:{true:{}},shadow:{true:{normalShadowVar:"$$paginationShadowColor"}}},compoundVariants:[{rounded:!0,noMargin:!0,css:{br:"$pill"}}]});export const StyledPagination=n("nav",{m:0,p:0,d:"inline-flex",position:"relative",fontVariant:"tabular-nums",fontFeatureSettings:"tnum",variants:{color:{default:{$$paginationColor:"$colors$primary",$$paginationShadowColor:"$colors$primaryShadow"},primary:{$$paginationColor:"$colors$primary",$$paginationShadowColor:"$colors$primaryShadow"},secondary:{$$paginationColor:"$colors$secondary",$$paginationShadowColor:"$colors$secondaryShadow"},success:{$$paginationColor:"$colors$success",$$paginationShadowColor:"$colors$successShadow"},warning:{$$paginationColor:"$colors$warning",$$paginationShadowColor:"$colors$warningShadow"},error:{$$paginationColor:"$colors$error",$$paginationShadowColor:"$colors$errorShadow"},gradient:{$$paginationColor:"$colors$gradient",$$paginationShadowColor:"$colors$primaryShadow"}},size:{xs:{$$paginationWidth:"$space$10",$$paginationFontSize:"$space$5",fs:"$$paginationFontSize"},sm:{$$paginationWidth:"$space$12",$$paginationFontSize:"$space$6",fs:"$$paginationFontSize"},md:{$$paginationWidth:"$space$13",$$paginationFontSize:"$space$7",fs:"$$paginationFontSize"},lg:{$$paginationWidth:"$space$14",$$paginationFontSize:"$space$8",fs:"$$paginationFontSize"},xl:{$$paginationWidth:"$space$15",$$paginationFontSize:"$space$9",fs:"$$paginationFontSize"}},borderWeight:{light:{$$paginationItemBorderWeight:"$borderWeights$light"},normal:{$$paginationItemBorderWeight:"$borderWeights$normal"},bold:{$$paginationItemBorderWeight:"$borderWeights$bold"},extrabold:{$$paginationItemBorderWeight:"$borderWeights$extrabold"},black:{$$paginationItemBorderWeight:"$borderWeights$black"}},bordered:{true:{}},onlyDots:{true:{$$paginationSize:"calc($$paginationWidth / 2)",$$paginationItemRadius:"$radii$pill",$$paginationScaleTransform:1.05},false:{$$paginationSize:"$$paginationWidth",$$paginationScaleTransform:1.1}},rounded:{true:{$$paginationItemRadius:"$radii$pill"},false:{$$paginationItemRadius:"$radii$squared"}},noMargin:{true:{$$paginationItemRadius:"0px",$$paginationItemMargin:"0",[`& ${StyledPaginationItem}:first-of-type`]:{btlr:"$squared",bblr:"$squared"},[`& ${StyledPaginationItem}:last-of-type`]:{btrr:"$squared",bbrr:"$squared"}},false:{$$paginationItemMargin:"$space$1"}}},compoundVariants:[{bordered:!0,noMargin:!0,css:{[`& ${StyledPaginationItem}:not(:last-child)`]:{borderRight:0}}},{noMargin:!0,rounded:!0,css:{$$paginationItemRadius:"0px"}},{rounded:!1,noMargin:!0,css:{$$paginationItemRadius:"0px"}}],defaultVariants:{color:"default",size:"md",borderWeight:"normal",onlyDots:!1,noMargin:!1,rounded:!1}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"react";import{useModal as o,useOverlay as r,DismissButton as s}from"@react-aria/overlays";import{useDialog as i}from"@react-aria/dialog";import{FocusScope as t,useFocusRing as n}from"@react-aria/focus";import{mergeProps as a}from"@react-aria/utils";import l from"../utils/css-transition";import{__DEV__ as m}from"../utils/assertion";import{mergeRefs as p}from"../utils/refs";import{StyledPopoverContentContainer as c,StyledPopoverContent as d}from"./popover.styles";import{usePopoverContext as u}from"./popover-context";import{getTransformOrigin as f}from"./utils";import v from"../utils/clsx";import{jsx as b}from"react/jsx-runtime";import{jsxs as h}from"react/jsx-runtime";import{Fragment as x}from"react/jsx-runtime";export const PopoverContent=e.forwardRef(((e,m)=>{const{children:O,as:C,css:P,className:g,...D}=e,{state:y,placement:j,overlayRef:F,disableAnimation:N,disableShadow:B,shouldCloseOnBlur:E,isDismissable:w,isKeyboardDismissDisabled:I,shouldCloseOnInteractOutside:S,getPopoverProps:T,isBordered:K,borderWeight:R,onClose:V,onEntered:W,onExited:A}=u(),U=f(j),{modalProps:k}=o({isDisabled:!0}),{dialogProps:q}=i({role:"dialog"},F),{overlayProps:z}=r({onClose:V,isOpen:y.isOpen,isDismissable:w&&y.isOpen,shouldCloseOnBlur:E,isKeyboardDismissDisabled:I,shouldCloseOnInteractOutside:S},F),G=a({isBordered:K,disableShadow:B,borderWeight:R},D),{isFocusVisible:H,focusProps:J}=n(),L=h(c,{ref:p(F,m),...T(a(z,k,q,J,G)),className:v("nextui-popover-content-container",g),isFocusVisible:H,as:C,css:{transformOrigin:U,...P},children:[b(s,{onDismiss:V}),b(d,{className:"nextui-popover-content",children:O}),b(s,{onDismiss:V})]});return b(x,{children:N?y.isOpen?b(t,{restoreFocus:!0,children:L}):null:b(t,{restoreFocus:!0,children:b(l,{visible:y.isOpen,name:"nextui-popover-content",enterTime:20,leaveTime:60,clearTime:300,onExited:A,onEntered:W,children:L})})})}));m&&(PopoverContent.displayName="NextUI.PopoverContent"),PopoverContent.toString=()=>".nextui-popover-content";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as r from"react";import{useButton as o}from"@react-aria/button";import{mergeProps as e}from"@react-aria/utils";import{usePopoverContext as t}from"./popover-context";import{pickChild as i}from"../utils/collections";import{Button as p}from"../index";import{__DEV__ as n}from"../utils/assertion";export const PopoverTrigger=n=>{const{state:s,triggerRef:g,getTriggerProps:m}=t(),l=()=>s.open(),{buttonProps:
|
|
1
|
+
import*as r from"react";import{useButton as o}from"@react-aria/button";import{mergeProps as e}from"@react-aria/utils";import{usePopoverContext as t}from"./popover-context";import{pickChild as i}from"../utils/collections";import{Button as p}from"../index";import{__DEV__ as n}from"../utils/assertion";export const PopoverTrigger=n=>{const{state:s,triggerRef:g,getTriggerProps:m}=t(),{children:l,...a}=n,c=()=>s.open(),{buttonProps:f}=o({onPress:c,...a},g),u=r.Children.only(l),[,v]=i(n.children,p),P=void 0!==(null==v?void 0:v[0]);return r.cloneElement(u,m(e(u.props,P?{onPress:c,...a}:f),u.ref))};n&&(PopoverTrigger.displayName="NextUI.PopoverTrigger"),PopoverTrigger.toString=()=>".nextui-popover-trigger";
|
package/esm/popover/popover.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import r from"react";import{OverlayContainer as
|
|
1
|
+
import r from"react";import{OverlayContainer as e}from"@react-aria/overlays";import{usePopover as o}from"./use-popover";import{PopoverProvider as t}from"./popover-context";import{__DEV__ as i}from"../utils/assertion";import{jsx as a}from"react/jsx-runtime";import{jsxs as m}from"react/jsx-runtime";const p=r.forwardRef(((i,p)=>{const{children:s,...n}=i,f=o({ref:p,...n}),[c,l]=r.Children.toArray(s),x=f.state.isOpen||!f.exited;return m(t,{value:f,children:[c,x&&a(e,{children:l})]})}));i&&(p.displayName="NextUI.Popover"),p.toString=()=>".nextui-popover";export default p;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{styled as o,keyframes as
|
|
1
|
+
import{styled as o,keyframes as e}from"../theme/stitches.config";import{cssFocusVisible as r}from"../theme/shared-css";export const appearanceIn=e({"0%":{opacity:0,transform:"scale(0.95)"},"60%":{opacity:.75,transform:"scale(1.05)"},"100%":{opacity:1,transform:"scale(1)"}});export const appearanceOut=e({"0%":{opacity:1,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(0.5)"}});export const StyledPopoverContentContainer=o("div",{$$popoverMinWidth:"$space$13",$$popoverMinHeight:"$space$13",$$popoverBorderRadius:"$radii$lg",$$popoverBackground:"$colors$backgroundContrast",$$popoverBoxShadow:"$shadows$md",$$popoverBorderColor:"$colors$border",boxShadow:"$$popoverBoxShadow",outline:"none",overflow:"hidden auto",bg:"$$popoverBackground",display:"inline-flex",flexDirection:"column",boxSizing:"border-box",minWidth:"$$popoverMinWidth",minHeight:"$$popoverMinHeight",maxWidth:"calc(100% - $$popoverMinWidth)",maxHeight:"calc(100% - $$popoverMinWidth)",borderRadius:"$$popoverBorderRadius",animationFillMode:"forwards",willChange:"transform, opacity","@motion":{transition:"none"},"&.nextui-popover-content-enter":{animationName:appearanceIn,animationTimingFunction:"ease-out",animationDirection:"normal",animationDuration:"250ms"},"&.nextui-popover-content-leave":{animationName:appearanceOut,animationTimingFunction:"ease-in",animationDuration:"60ms"},variants:{disableShadow:{true:{boxShadow:"none"}},isBordered:{true:{borderStyle:"solid",borderColor:"$$popoverBorderColor"}},borderWeight:{light:{bw:"$light",$$popoverBorderWeight:"$borderWeights$light"},normal:{bw:"$normal",$$popoverBorderWeight:"$borderWeights$normal"},bold:{bw:"$bold",$$popoverBorderWeight:"$borderWeights$bold"},extrabold:{bw:"$extrabold",$$popoverBorderWeight:"$borderWeights$extrabold"},black:{bw:"$black",$$popoverBorderWeight:"$borderWeights$black"}}},defaultVariants:{isBordered:!1,borderWeight:"light"}},r);export const StyledPopoverContent=o("div",{transform:"translateZ(0)",backfaceVisibility:"hidden"});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useRef as e,useMemo as
|
|
1
|
+
import{useRef as e,useMemo as o,useState as r,useCallback as s}from"react";import{mergeProps as i}from"@react-aria/utils";import{useOverlayPosition as t,useOverlayTrigger as l}from"@react-aria/overlays";import{useOverlayTriggerState as a}from"@react-stately/overlays";import{mergeRefs as n}from"../utils/refs";import{getAriaPlacement as p}from"./utils";export function usePopover(d={}){const{ref:u,triggerRef:f,scrollRef:m,isOpen:g,defaultOpen:O,onOpenChange:c,isBordered:b,borderWeight:h,disableShadow:y,shouldFlip:P=!0,offset:v=12,placement:C="bottom",onClose:R,triggerType:D="dialog",isDismissable:B=!0,shouldCloseOnBlur:x=!1,isKeyboardDismissDisabled:w=!1,disableAnimation:A=!1,shouldCloseOnInteractOutside:E}=d,F=e(null),I=e(null),K=u||F,S=f||I,T=a({isOpen:g,defaultOpen:O,onOpenChange:c}),[W,j]=r(!T.isOpen),k=o((()=>T.isOpen?"open":"closed"),[T.isOpen]),q=s((()=>{null==R||R(),T.close()}),[T,R]),z=s((()=>{j(!1)}),[]),G=s((()=>{j(!0)}),[]),{triggerProps:H,overlayProps:J}=l({type:D},T,S),L=o((()=>p(C)),[C]),{overlayProps:M}=t({isOpen:T.isOpen,targetRef:S,scrollRef:m,placement:L,overlayRef:K,shouldFlip:P,offset:v}),N=s(((e={},o=null)=>({...null!=f&&f.current?i(H,e):i(e,H),ref:n(S,o)})),[S,f,H]),Q=s(((e={})=>({...e,...J,...M,"data-state":k,"data-placement":C})),[k,M,J,C]);return{state:T,exited:W,overlayRef:K,triggerRef:S,placement:C,disableShadow:y,disableAnimation:A,shouldCloseOnBlur:x,isDismissable:B,isBordered:b,borderWeight:h,isKeyboardDismissDisabled:w,shouldCloseOnInteractOutside:E,isOpen:T.isOpen,onClose:q,onExited:G,onEntered:z,triggerProps:H,overlayProps:J,positionProps:M,getTriggerProps:N,getPopoverProps:Q}}
|
package/esm/popover/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const getAriaPlacement=t=>t?t.replace("-"," "):"bottom";export const getTransformOrigin=t=>{if(!t)return"bottom";switch(t){case"bottom":default:return"top center";case"top":return"bottom center";case"left":return"right center";case"right":return"left center";case"bottom-left":return"top left";case"bottom-right":return"top right";case"top-left":return"bottom left";case"top-right":return"bottom right";case"left-top":return"right top";case"left-bottom":return"right bottom";case"right-top":return"left top";case"right-bottom":return"left bottom"}};
|
|
1
|
+
export const getAriaPlacement=t=>t?t.replace("-"," "):"bottom";export const getPopoverPlacementFromAxis=t=>t?t.replace("-"," "):"bottom";export const getPopoverPlacement=t=>t?t.replace(" ","-"):"bottom";export const getTransformOrigin=t=>{if(!t)return"bottom";switch(t){case"bottom":default:return"top center";case"top":return"bottom center";case"left":return"right center";case"right":return"left center";case"bottom-left":return"top left";case"bottom-right":return"top right";case"top-left":return"bottom left";case"top-right":return"bottom right";case"left-top":return"right top";case"left-bottom":return"right bottom";case"right-top":return"left top";case"right-bottom":return"left bottom"}};
|
package/esm/radio/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"./radio";import
|
|
1
|
+
import o from"./radio";import d from"./radio-group";o.Group=d;export{StyledRadioLabel,StyledRadioText,StyledRadioPoint,StyledRadioContainer,StyledRadioDescription,StyledRadioGroup,StyledRadioGroupContainer}from"./radio.styles";export default o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{createContext as o}from"../utils/context";export const[RadioGroupProvider,useRadioGroupContext]=o({name:"RadioGroupContext",strict:!0,errorMessage:"useRadioGroupContext: `context` is undefined. Seems you forgot to wrap all checkbox components within `<Radio.Group />`"});
|
package/esm/radio/radio-group.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import o
|
|
1
|
+
import r from"react";import o from"../utils/clsx";import{useDOMRef as i}from"../utils/dom";import{useRadioGroup as e}from"./use-radio-group";import{RadioGroupProvider as a}from"./radio-context";import{StyledRadioGroup as s,StyledRadioGroupContainer as t,StyledRadioGroupLabel as l}from"./radio.styles";import{__DEV__ as m}from"../utils/assertion";import{jsx as p}from"react/jsx-runtime";import{jsxs as u}from"react/jsx-runtime";export const RadioGroup=r.forwardRef(((r,m)=>{const{as:d,css:n,className:c,children:f,label:x,...R}=r,g=e({...R,label:x}),h=i(m);return u(s,{ref:h,className:o("nextui-radio-group",c),as:d,css:n,size:g.size,...g.radioGroupProps,children:[x&&p(l,{className:"nextui-radio-group-label",...g.labelProps,children:x}),p(t,{className:"nextui-radio-group-items",role:"presentation",isRow:"horizontal"===g.orientation,children:p(a,{value:g,children:f})})]})}));m&&(RadioGroup.displayName="NextUI.RadioGroup"),RadioGroup.toString=()=>".nextui-radio-group";export default RadioGroup;
|
package/esm/radio/radio.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import i,{useMemo as e}from"react";import{mergeProps as s}from"@react-aria/utils";import{useFocusRing as r}from"@react-aria/focus";import{VisuallyHidden as a}from"@react-aria/visually-hidden";import o from"../utils/clsx";import{__DEV__ as t}from"../utils/assertion";import{useFocusableRef as d}from"../utils/dom";import{useRadio as l}from"./use-radio";import{StyledRadioText as c,StyledRadioPoint as n,StyledRadioLabel as m,StyledRadioDescription as u,StyledRadioContainer as p}from"./radio.styles";import{jsx as f}from"react/jsx-runtime";import{jsxs as h}from"react/jsx-runtime";export const Radio=i.forwardRef(((i,t)=>{const{className:x,as:b,css:v,children:N,label:R,description:k,...I}=i,{size:j,color:D,inputRef:F,labelColor:y,isHovered:P,isSquared:S,isInvalid:q,isDisabled:z,autoFocus:A,disableAnimation:C,hoverProps:H,inputProps:V}=l({...I,children:null!=N?N:R}),g=d(t,F),{focusProps:w,isFocusVisible:U}=r({autoFocus:A}),$=e((()=>P?"is-hovered":z?"is-disabled":V.checked?"checked":"uncheked"),[z,V.checked,P]);return h(m,{ref:g,...H,className:o("nextui-radio-label",`nextui-radio--${$}`,x),as:b,css:v,size:j,color:D,"data-state":$,isSquared:S,isHovered:P,isInvalid:q,isChecked:V.checked,isDisabled:z,disableAnimation:C,children:[h(p,{className:"nextui-radio-container",children:[f(n,{className:"nextui-radio-point",isFocusVisible:U,...w,children:f(a,{children:f("input",{ref:F,className:"nextui-radio-input",...s(V,w)})})}),f(c,{color:y,isInvalid:q,isDisabled:z,className:"nextui-radio-label",children:N})]}),k&&f(u,{className:"nextui-radio-description",isInvalid:q,isDisabled:z,children:k})]})}));t&&(Radio.displayName="NextUI.Radio"),Radio.toString=()=>".nextui-radio";export default Radio;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{styled as o
|
|
1
|
+
import{styled as o}from"../theme/stitches.config";import{cssFocusVisible as r}from"../theme/shared-css";export const StyledRadioText=o("span",{fontSize:"$$radioSize",us:"none",d:"inline-flex",ai:"center",variants:{color:{default:{color:"$text"},primary:{color:"$primary"},secondary:{color:"$secondary"},success:{color:"$success"},warning:{color:"$warning"},error:{color:"$error"}},isDisabled:{true:{color:"$accents5"}},isInvalid:{true:{color:"$error"}}}});export const StyledRadioPoint=o("span",{size:"$$radioSize",br:"$$radioRadii",position:"relative",d:"inline-block",mr:"calc($$radioSize * 0.375)","&:after":{content:"",d:"block",position:"absolute",size:"$$radioSize",br:"$$radioRadii",boxSizing:"border-box",border:"2px solid $border"}},r);export const StyledRadioLabel=o("label",{d:"flex",w:"initial",ai:"flex-start",position:"relative",fd:"column",jc:"flex-start",cursor:"pointer","@motion":{[`& ${StyledRadioPoint}`]:{transition:"none","&:after":{transition:"none"}}},variants:{color:{default:{$$radioColor:"$colors$primary",$$radioColorHover:"$colors$primarySolidHover"},primary:{$$radioColor:"$colors$primary",$$radioColorHover:"$colors$primarySolidHover"},secondary:{$$radioColor:"$colors$secondary",$$radioColorHover:"$colors$secondarySolidHover"},success:{$$radioColor:"$colors$success",$$radioColorHover:"$colors$successSolidHover"},warning:{$$radioColor:"$colors$warning",$$radioColorHover:"$colors$warningSolidHover"},error:{$$radioColor:"$colors$error",$$radioColorHover:"$colors$errorSolidHover"}},size:{xs:{$$radioSize:"$space$7"},sm:{$$radioSize:"$space$8"},md:{$$radioSize:"$space$9"},lg:{$$radioSize:"$space$10"},xl:{$$radioSize:"$space$11"}},isHovered:{true:{}},isInvalid:{true:{$$radioColor:"$colors$error",$$radioColorHover:"$colors$errorSolidHover",[`& ${StyledRadioPoint}`]:{"&:after":{borderColor:"$colors$error"}}}},isDisabled:{true:{cursor:"not-allowed",$$radioColor:"$colors$accents4"}},isSquared:{true:{$$radioRadii:"$radii$squared"},false:{$$radioRadii:"$radii$rounded"}},isChecked:{true:{[`& ${StyledRadioPoint}`]:{"&:after":{border:"calc($$radioSize * 0.34) solid $$radioColor"}}}},disableAnimation:{true:{[`& ${StyledRadioPoint}`]:{transition:"none","&:after":{transition:"none"}}},false:{[`& ${StyledRadioPoint}`]:{transition:"$default","&:after":{transition:"$default"}}}}},defaultVariants:{size:"md",isSquared:!1,disableAnimation:!1},compoundVariants:[{isChecked:!0,isHovered:!0,css:{[`& ${StyledRadioPoint}`]:{"&:after":{border:"calc($$radioSize * 0.34) solid $$radioColorHover"}}}},{isChecked:!0,isDisabled:!0,isHovered:!0,css:{[`& ${StyledRadioPoint}`]:{"&:after":{border:"calc($$radioSize * 0.34) solid $$radioColor"}}}},{isChecked:!1,isDisabled:!1,isHovered:!0,css:{[`& ${StyledRadioPoint}`]:{bg:"$border"}}}]});export const StyledRadioDescription=o("span",{color:"$accents7",fontSize:"calc($$radioSize * 0.85)",paddingLeft:"calc($$radioSize + $$radioSize * 0.375)",variants:{isInvalid:{true:{color:"$red500"}},isDisabled:{true:{color:"$accents5"}}}});export const StyledRadioContainer=o("div",{w:"initial",position:"relative",d:"flex",fd:"row",ai:"center",jc:"flex-start"});export const StyledRadioGroupLabel=o("label",{d:"block",fontWeight:"$normal",fontSize:"calc($$checkboxSize * 0.9)",color:"$accents8",mb:"$3"});export const StyledRadioGroup=o("div",{border:0,margin:0,padding:0,display:"flex",fd:"column",variants:{size:{xs:{$$radioGroupGap:"$space$7"},sm:{$$radioGroupGap:"$space$8"},md:{$$radioGroupGap:"$space$9"},lg:{$$radioGroupGap:"$space$10"},xl:{$$radioGroupGap:"$space$11"}}}});export const StyledRadioGroupContainer=o("div",{display:"flex",flexDirection:"column",variants:{isRow:{true:{mt:0,flexDirection:"row",[`& ${StyledRadioLabel}:not(:last-child)`]:{mr:"$$radioSize"}},false:{mr:0,flexDirection:"column",[`& ${StyledRadioLabel}:not(:first-child)`]:{mt:"$$radioSize"}}}},defaultVariants:{isRow:!1}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useMemo as o}from"react";import{useRadioGroupState as r}from"@react-stately/radio";import{useRadioGroup as a}from"@react-aria/radio";export const useRadioGroup=t=>{const{size:i="md",color:e="default",labelColor:l="default",orientation:d="vertical",isRequired:s,validationState:p,...u}=t,n=o((()=>({...u,orientation:d})),[u]),c=r(n),{radioGroupProps:m,labelProps:f}=a(n,c);return{size:i,color:e,orientation:d,labelColor:l,isRequired:s,validationState:p,radioGroupState:c,radioGroupProps:m,labelProps:f}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useRef as o,useMemo as i}from"react";import{useRadio as e}from"@react-aria/radio";import{useHover as r}from"@react-aria/interactions";import a from"../use-warning";import{__DEV__ as t}from"../utils/assertion";import{useRadioGroupContext as l}from"./radio-context";export const useRadio=s=>{var d,n,u;const p=l(),{size:c=(null!=(d=p.size)?d:"md"),color:m=(null!=(n=p.color)?n:"default"),labelColor:v=(null!=(u=p.labelColor)?u:"default"),autoFocus:f,isSquared:b=!1,disableAnimation:R=!1,...h}=s;p&&t&&(void 0!==h.checked&&a('Remove props "checked" if in the Radio.Group.',"Radio"),void 0===h.value&&a('Props "value" must be defined if in the Radio.Group.',"Radio"));const P=o(null),{inputProps:S}=e(h,p.radioGroupState,P),z=i((()=>{var o;return null!=(o=S.disabled)&&o}),[S.disabled]),{hoverProps:C,isHovered:G}=r({isDisabled:z});return{size:c,color:m,inputRef:P,autoFocus:f,isDisabled:z,labelColor:v,isInvalid:i((()=>"invalid"===p.validationState),[p.validationState]),isHovered:G,isSquared:b,disableAnimation:R,inputProps:S,hoverProps:C}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{styled as
|
|
1
|
+
import{styled as r}from"../theme/stitches.config";import{sharedFocus as o}from"../theme/shared-css";export const StyledSnippet=r("div",{display:"flex",position:"relative",width:"initial",maxWidth:"100%",padding:"calc($space$lg * 0.75) $space$lg",br:"$lg",bg:"$background",variants:{color:{default:{$$snippetBorderColor:"$border",$$snippetBgColor:"$background",color:"$text"},primary:{$$snippetBorderColor:"$border",$$snippetBgColor:"$primary",color:"$text"},success:{$$snippetBorderColor:"$success",$$snippetBgColor:"$background",color:"$success"},warning:{$$snippetBorderColor:"$warning",$$snippetBgColor:"$background",color:"$warning"},error:{$$snippetBorderColor:"$error",$$snippetBgColor:"$background",color:"$error"},secondary:{$$snippetBorderColor:"$secondary",$$snippetBgColor:"$background",color:"$secondary"},invert:{$$snippetBorderColor:"$foreground",$$snippetBgColor:"$foreground",color:"$background"}},borderWeight:{light:{$$borderWeight:"$light"},normal:{$$borderWeight:"$normal"},bold:{$$borderWeight:"$bold"},extrabold:{$$borderWeight:"$extrabold"},black:{$$borderWeight:"$black"}},bordered:{true:{border:"$$borderWeight solid $$snippetBorderColor"}},filled:{true:{backgroundColor:"$$snippetBgColor"}}},defaultVariants:{color:"default",borderWeight:"normal",filled:!1}});export const StyledSnippetPre=r("pre",{margin:0,padding:0,border:"none",br:0,bgColor:"transparent",color:"inherit",fontSize:"$sm","*":{margin:0,padding:0,fontSize:"inherit",color:"inherit"},variants:{withCopyButton:{true:{width:"calc(100% - 2 * $lg)"},false:{width:"100%"}}}});export const StyledSnippetCopyButtonIcon=r("svg",{});export const StyledSnippetCopyButton=r("button",{display:"inline-flex",jc:"center",border:"none",ai:"flex-start",bg:"transparent",width:"calc(2 * $space$lg)",br:"$xs",color:"inherit",transition:"opacity 0.2s ease 0s",cursor:"pointer",us:"none","@motion":{transition:"none"},"&:hover":{opacity:"0.7"},[`& ${StyledSnippetCopyButtonIcon}`]:{path:{fill:"$accents6"}}},o);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{styled as t
|
|
1
|
+
import{styled as t}from"../theme/stitches.config";import{sharedFocus as i,sharedVisuallyHidden as o}from"../theme/shared-css";export const StyledSwitchContainer=t("label",{WebkitTapHighlightColor:"transparent",d:"inline-block",verticalAlign:"center",whiteSpace:"nowrap",us:"none",transition:"$default",padding:"$1 0",position:"relative",cursor:"pointer","@motion":{transition:"none"},variants:{color:{default:{$$switchColor:"$colors$primary",$$switchColorShadow:"$colors$primaryShadow",$$switchColorHover:"$colors$primarySolidHover"},primary:{$$switchColor:"$colors$primary",$$switchColorShadow:"$colors$primaryShadow",$$switchColorHover:"$colors$primarySolidHover"},secondary:{$$switchColor:"$colors$secondary",$$switchColorShadow:"$colors$secondaryShadow",$$switchColorHover:"$colors$secondarySolidHover"},success:{$$switchColor:"$colors$success",$$switchColorShadow:"$colors$successShadow",$$switchColorHover:"$colors$successSolidHover"},warning:{$$switchColor:"$colors$warning",$$switchColorShadow:"$colors$warningShadow",$$switchColorHover:"$colors$warningSolidHover"},error:{$$switchColor:"$colors$error",$$switchColorShadow:"$colors$errorShadow",$$switchColorHover:"$colors$errorSolidHover"}},size:{xs:{$$switchWidth:"$space$12",$$switchHeight:"$space$9",width:" $$switchWidth",maxWidth:"$$switchWidth",height:"$$switchHeight"},sm:{$$switchWidth:"$space$14",$$switchHeight:"$space$10",width:"$$switchWidth",maxWidth:"$$switchWidth",height:"$$switchHeight"},md:{$$switchWidth:"$space$15",$$switchHeight:"$space$11",width:"$$switchWidth",maxWidth:"$$switchWidth",height:"$$switchHeight"},lg:{$$switchWidth:"$space$17",$$switchHeight:"$space$12",width:"$$switchWidth",maxWidth:"$$switchWidth",height:"$$switchHeight"},xl:{$$switchWidth:"$space$18",$$switchHeight:"$space$13",width:"$$switchWidth",maxWidth:"$$switchWidth",height:"$$switchHeight"}},borderWeight:{light:{$$switchBorderW:"$borderWeights$light"},normal:{$$switchBorderW:"$borderWeights$normal"},bold:{$$switchBorderW:"$borderWeights$bold"},extrabold:{$$switchBorderW:"$borderWeights$extrabold"},black:{$$switchBorderW:"$borderWeights$black"}},disabled:{true:{cursor:"not-allowed"}},animated:{false:{transition:"none"}}},defaultVariants:{color:"default",size:"md",borderWeight:"normal"}});export const StyledSwitchInput=t("input",{},o);export const StyledSwitchCircle=t("span",{position:"absolute",display:"flex",size:"calc($$switchHeight * 0.7)",jc:"center",ai:"center",top:"50%",transform:"translateY(-50%)",left:"calc($$switchWidth / 15)",transition:"left 0.25s ease, width 0.2s ease",bg:"$background",br:"$pill","& svg":{bg:"transparent",size:"calc($$switchHeight * 0.44)"},"@motion":{transition:"none"}});export const StyledSwitch=t("div",{opacity:1,width:"$$switchWidth",height:"$$switchHeight",transition:"$default",position:"relative",overflow:"hidden",padding:0,br:"$pill",bg:"$accents2","@motion":{transition:"none"},variants:{checked:{true:{bg:"$$switchColor",[`& ${StyledSwitchCircle}`]:{left:"calc(100% - ($$switchWidth / 15) - $$switchHeight * 0.7)"},"&:hover:not(&:active)":{bg:"$$switchColorHover"}}},bordered:{true:{bg:"transparent",border:"$$switchBorderW solid $border","&:hover":{borderColor:"$$switchColor"},[`& ${StyledSwitchCircle}`]:{left:"calc(($$switchWidth / 15) - ($$switchBorderW / 2))",bg:"$accents2"}}},squared:{true:{br:"2px",[`& ${StyledSwitchCircle}`]:{br:"2px"}}},shadow:{true:{}},disabled:{true:{borderColor:"$accents2",bg:"$accents2",[`& ${StyledSwitchCircle}`]:{bg:"$accents4"}}},animated:{true:{"&:active":{[`& ${StyledSwitchCircle}`]:{width:"calc($$switchHeight * 0.7 + ($$switchWidth / 10))"}}},false:{transition:"none",[`& ${StyledSwitchCircle}`]:{transition:"none"}}}},compoundVariants:[{checked:!0,disabled:!0,css:{bg:"$accents3",[`& ${StyledSwitchCircle}`]:{bg:"$accents0"},"&:hover:not(&:active)":{bg:"$accents4"}}},{shadow:!0,checked:!0,css:{normalShadowVar:"$$switchColorShadow"}},{animated:!0,checked:!1,css:{"&:active":{[`& ${StyledSwitchCircle}`]:{left:"calc($$switchWidth / 7.5)"}}}},{animated:!0,checked:!0,css:{"&:active":{[`& ${StyledSwitchCircle}`]:{left:"calc(100% - ($$switchWidth / 5) - $$switchHeight * 0.7)"}}}},{checked:!0,bordered:!0,css:{bg:"$$switchColor",border:"$$switchBorderW solid transparent","&:hover:not(&:active)":{borderColor:"transparent"},[`& ${StyledSwitchCircle}`]:{left:"calc(100% - ($$switchWidth / 15) - $$switchHeight * 0.7 + ($$switchBorderW / 2))",bg:"$background"}}}]},i);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{styled as e
|
|
1
|
+
import{styled as e}from"../theme/stitches.config";import{cssFocusVisible as t}from"../theme/shared-css";export const StyledTableHeaderRow=e("tr",{ov:"visible"});export const StyledTableColumnHeader=e("th",{height:"$14",cursor:"default",bg:"$accents0",color:"$accents7",fontSize:"$xs",textAlign:"left",position:"relative","@motion":{transition:"none"},"&:first-child":{pl:"$8",br:"$md 0 0 $md"},"&:last-child":{pr:"$8",br:"0 $md $md 0"},variants:{align:{start:{textAlign:"left"},center:{textAlign:"center"},end:{textAlign:"right"}},animated:{false:{transition:"none"}},allowsSorting:{true:{transition:"background 0.25s ease 0s, color 0.25s ease 0s",cursor:"pointer","@motion":{transition:"none"},"&:hover":{color:"$accents8",bg:"$accents1"}}}},defaultVariants:{align:"left",animated:!0},compoundVariants:[{animated:!1,allowsSorting:!0,css:{transition:"none"}}]},t);export const StyledTableHeaderCell=e(StyledTableColumnHeader,t);export const StyledTableFooter=e("tfoot",{height:"$14",variants:{align:{start:{textAlign:"left"},center:{textAlign:"center"},end:{textAlign:"right"}}},defaultVariants:{align:"right"}});export const StyledBaseTableCell=e("td",{});export const StyledTableCell=e(StyledBaseTableCell,{position:"relative",userSelect:"none",py:"$5",pr:"$5",zIndex:"$2",ov:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis","&:first-child":{pl:"$8"},"&:last-child":{pr:"$8"},"&:before":{zIndex:"-$1",transition:"background 0.25s ease 0s, opacity 0.25s ease 0s",content:'""',position:"absolute",size:"100%",top:0,left:0,opacity:0,transform:"translateZ(0)",backfaceVisibility:"hidden"},variants:{align:{start:{textAlign:"left"},center:{textAlign:"center"},end:{textAlign:"right"}}}},t);export const StyledTableRow=e("tr",{ov:"visible",color:"$text",variants:{isDisabled:{true:{color:"$accents3",pointerEvents:"none",cursor:"not-allowed"}},isSelected:{true:{color:"$$tableRowTextColor",[`& ${StyledTableCell}:before`]:{opacity:1,bg:"$$tableRowColor"}}}}},t);export const StyledTableRowGroup=e("thead",{variants:{isFixed:{true:{display:"table",width:"100%",tableLayout:"fixed"}},isInfinityScroll:{true:{display:"block",height:"100%",overflow:"auto",[`& ${StyledTableRow}`]:{display:"table",width:"100%",tableLayout:"fixed"}}}},defaultVariants:{isInfinityScroll:!1}});export const StyledTableLoadingRow=e("tr",{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",height:"calc(100% - $space$14)",variants:{isAtEnd:{true:{height:"$space$18"}},isAbsolute:{true:{position:"absolute",left:"0",top:"$10"}}}});export const StyledTable=e("table",{borderCollapse:"separate",borderSpacing:0,width:"100%",p:"$md $sm","@motion":{[`& ${StyledTableCell}:before`]:{transition:"none"}},variants:{animated:{false:{[`& ${StyledTableCell}:before`]:{transition:"none"}}},color:{primary:{$$tableRowColor:"$colors$primaryLight",$$tableRowTextColor:"$colors$primaryLightContrast"},secondary:{$$tableRowColor:"$colors$secondaryLight",$$tableRowTextColor:"$colors$secondaryLightContrast"},success:{$$tableRowColor:"$colors$successLight",$$tableRowTextColor:"$colors$successLightContrast"},warning:{$$tableRowColor:"$colors$warningLight",$$tableRowTextColor:"$colors$warningLightContrast"},error:{$$tableRowColor:"$colors$errorLight",$$tableRowTextColor:"$colors$errorLightContrast"}},striped:{true:{[`& ${StyledTableRow}[aria-selected=false]:nth-child(even)`]:{[`& ${StyledTableCell}`]:{bg:"$accents0"}},[`& ${StyledTableRow}:nth-child(even)`]:{[`& ${StyledTableCell}:first-child`]:{br:"$lg 0 0 $lg"},[`& ${StyledTableCell}:last-child`]:{br:"0 $lg $lg 0"}}}},sticked:{true:{p:0,[`& ${StyledTableColumnHeader}:first-child`]:{br:"$lg 0 0 0"},[`& ${StyledTableColumnHeader}:last-child`]:{br:"0 $lg 0 0"}}},lineWeight:{light:{$$tableLineWeight:"$borderWeights$light"},normal:{$$tableLineWeight:"$borderWeights$normal"},bold:{$$tableLineWeight:"$borderWeights$bold"},extrabold:{$$tableLineWeight:"$borderWeights$extrabold"},black:{$$tableLineWeight:"$borderWeights$black"}},headerLined:{true:{[`& ${StyledTableColumnHeader}`]:{position:"relative",bg:"transparent","&:after":{content:"",position:"absolute",left:0,right:0,bottom:0,height:"calc($$tableLineWeight * 1.5)",bg:"$accents1"},"&:first-child":{ml:"$12",br:"0","&:after":{left:"$space$md"}},"&:last-child":{br:"0","&:after":{right:"$space$md"}}}}},lined:{true:{[`& ${StyledTableRow}:not(:last-child)`]:{position:"relative",[`& ${StyledTableCell}:after`]:{content:"",position:"absolute",bottom:0,left:0,right:0,height:"$$tableLineWeight",bg:"$border"},[`& ${StyledTableCell}:first-child`]:{"&:after":{left:"$space$md"}},[`& ${StyledTableCell}:last-child`]:{"&:after":{right:"$space$md"}}},[`& ${StyledTableRow}[aria-selected=true]:not(last-child)`]:{[`& ${StyledTableCell}:after`]:{bg:"$$tableRowTextColor",opacity:.3}}}},fixed:{true:{tableLayout:"fixed"}},hoverable:{true:{[`& ${StyledTableCell}:first-child`]:{br:"$md 0 0 $md"},[`& ${StyledTableCell}:last-child`]:{br:"0 $md $md 0"},[`& ${StyledTableRow}`]:{cursor:"pointer"},[`& ${StyledTableRow}[aria-selected=false]`]:{"&:hover":{[`& ${StyledTableCell}:before`]:{opacity:1,bg:"$accents0"}}},[`& ${StyledTableRow}[aria-selected=true]`]:{"&:hover":{[`& ${StyledTableCell}:before`]:{opacity:.8}}}},false:{[`& ${StyledTableCell}`]:{userSelect:"all"}}},isMultiple:{true:{}},hasPagination:{true:{}},shadow:{true:{}},compact:{true:{[`& ${StyledTableCell}`]:{py:"$1"},[`& ${StyledTableColumnHeader}`]:{height:"$12","&:first-child":{br:"$sm 0 0 $sm"},"&:last-child":{br:"0 $sm $sm 0"}}}}},compoundVariants:[{isMultiple:!0,hoverable:!0,css:{[`& ${StyledTableRow}:not(:first-child):not(:last-child)`]:{[`& ${StyledTableCell}:first-child`]:{br:0},[`& ${StyledTableCell}:last-child`]:{br:0}},[`& ${StyledTableRow}:first-child`]:{[`& ${StyledTableCell}:first-child`]:{br:"$md 0 0 0"},[`& ${StyledTableCell}:last-child`]:{br:"0 $md 0 0"}},[`& ${StyledTableRow}:last-child`]:{[`& ${StyledTableCell}:first-child`]:{br:"0 0 0 $md"},[`& ${StyledTableCell}:last-child`]:{br:"0 0 $md 0"}}}},{isMultiple:!0,hoverable:!0,sticked:!0,css:{[`& ${StyledTableRow}:first-child`]:{[`& ${StyledTableCell}:first-child`]:{br:"0"},[`& ${StyledTableCell}:last-child`]:{br:"0"}}}},{compact:!0,shadow:!0,css:{p:"$md $sm"}},{compact:!0,sticked:!0,css:{p:0}},{sticked:!0,isMultiple:!1,hoverable:!0,hasPagination:!1,css:{[`& ${StyledTableRow}:not(:last-child)`]:{[`& ${StyledTableCell}`]:{br:"0"}},[`& ${StyledTableRow}:last-child`]:{[`& ${StyledTableCell}:first-child`]:{br:"0 0 0 $md"},[`& ${StyledTableCell}:last-child`]:{br:"0 0 $md 0"}}}},{sticked:!0,isMultiple:!1,hoverable:!0,hasPagination:!0,css:{[`& ${StyledTableRow}`]:{[`& ${StyledTableCell}`]:{br:"0"}}}},{sticked:!0,hasPagination:!0,css:{pb:"$5"}},{sticked:!0,hasPagination:!0,isMultiple:!0,hoverable:!0,css:{[`& ${StyledTableRow}:last-child`]:{[`& ${StyledTableCell}:first-child`]:{br:"0"},[`& ${StyledTableCell}:last-child`]:{br:"0"}}}}],defaultVariants:{sticked:!1,color:"primary",lineWeight:"light"}});export const StyledTableContainer=e("div",{display:"flex",flexDirection:"column",br:"$xl",overflowX:"auto",overflowY:"hidden",variants:{shadow:{true:{bs:"$md"}},bordered:{true:{borderStyle:"solid",borderColor:"$border"},false:{bw:0}},borderWeight:{light:{bw:"$light"},normal:{bw:"$normal"},bold:{bw:"$bold"},extrabold:{bw:"$extrabold"},black:{bw:"$black"}}},defaultVariants:{shadow:!0,borderWeight:"normal"}});
|
package/esm/theme/colors/gray.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const gray={gray50:"#
|
|
1
|
+
export const gray={gray50:"#F1F3F5",gray100:"#ECEEF0",gray200:"#E6E8EB",gray300:"#DFE3E6",gray400:"#D7DBDF",gray500:"#C1C8CD",gray600:"#889096",gray700:"#7E868C",gray800:"#687076",gray900:"#11181C"};export const grayDark={gray50:"#16181A",gray100:"#26292B",gray200:"#2B2F31",gray300:"#313538",gray400:"#3A3F42",gray500:"#4C5155",gray600:"#697177",gray700:"#787F85",gray800:"#9BA1A6",gray900:"#ECEDEE"};
|
package/esm/theme/common.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defaultThemeMap as e}from"@stitches/react";export const defaultTokens={fonts:{sans:"-apple-system, BlinkMacSystemFont, 'Segoe UI','Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans','Helvetica Neue', sans-serif;",mono:"Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono','Courier New', monospace;"},fontSizes:{
|
|
1
|
+
import{defaultThemeMap as e}from"@stitches/react";export const defaultTokens={fonts:{sans:"-apple-system, BlinkMacSystemFont, 'Segoe UI','Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans','Helvetica Neue', sans-serif;",mono:"Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono','Courier New', monospace;"},fontSizes:{xs:"0.75rem",sm:"0.875rem",base:"1rem",md:"1rem",lg:"1.125rem",xl:"1.25rem",xl2:"1.5rem",xl3:"1.875rem",xl4:"2.25rem",xl5:"3rem",xl6:"3.75rem",xl7:"4.5rem",xl8:"6rem",xl9:"8rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},lineHeights:{xs:1,sm:1.25,base:1.5,md:1.5,lg:1.75,xl:1.75,xl2:2,xl3:2.25,xl4:2.5,xl5:1,xl6:1,xl7:1,xl8:1,xl9:1},letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},space:{0:"0rem",xs:"0.5rem",sm:"0.75rem",md:"1rem",lg:"1.25rem",xl:"2.25rem",px:"1px",1:"0.125rem",2:"0.25rem",3:"0.375rem",4:"0.5rem",5:"0.625rem",6:"0.75rem",7:"0.875rem",8:"1rem",9:"1.25rem",10:"1.5rem",11:"1.75rem",12:"2rem",13:"2.25rem",14:"2.5rem",15:"2.75rem",16:"3rem",17:"3.5rem",18:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},radii:{xs:"7px",sm:"9px",md:"12px",base:"14px",lg:"14px",xl:"18px",squared:"33%",rounded:"50%",pill:"9999px"},zIndices:{1:"100",2:"200",3:"300",4:"400",5:"500",10:"1000",max:"9999"},borderWeights:{light:"1px",normal:"2px",bold:"3px",extrabold:"4px",black:"5px"},transitions:{default:"all 250ms ease",button:"background 0.25s ease 0s, color 0.25s ease 0s, border-color 0.25s ease 0s, box-shadow 0.25s ease 0s, transform 0.25s ease 0s, opacity 0.25s ease 0s",avatar:"box-shadow 0.25s ease 0s, opacity 0.25s ease 0s",link:"opacity 0.25s ease 0s, background 0.25s ease 0s",card:"transform 0.25s ease 0s, filter 0.25s ease 0s, box-shadow 0.25s ease 0s",dropdownItem:"background 0.25s ease, transform 0.25s ease, color 0.15s ease, box-shadow 0.25s ease 0s"},breakpoints:{xs:"650px",sm:"960px",md:"1280px",lg:"1400px",xl:"1920px"}};export const defaultColors={white:"#ffffff",black:"#000000",primaryLight:"$blue200",primaryLightHover:"$blue300",primaryLightActive:"$blue400",primaryLightContrast:"$blue600",primary:"$blue600",primaryBorder:"$blue500",primaryBorderHover:"$blue600",primarySolidHover:"$blue700",primarySolidContrast:"$white",primaryShadow:"$blue500",secondaryLight:"$purple200",secondaryLightHover:"$purple300",secondaryLightActive:"$purple400",secondaryLightContrast:"$purple600",secondary:"$purple600",secondaryBorder:"$purple500",secondaryBorderHover:"$purple600",secondarySolidHover:"$purple700",secondarySolidContrast:"$white",secondaryShadow:"$purple500",successLight:"$green200",successLightHover:"$green300",successLightActive:"$green400",successLightContrast:"$green700",success:"$green600",successBorder:"$green500",successBorderHover:"$green600",successSolidHover:"$green700",successSolidContrast:"$white",successShadow:"$green500",warningLight:"$yellow200",warningLightHover:"$yellow300",warningLightActive:"$yellow400",warningLightContrast:"$yellow700",warning:"$yellow600",warningBorder:"$yellow500",warningBorderHover:"$yellow600",warningSolidHover:"$yellow700",warningSolidContrast:"$white",warningShadow:"$yellow500",errorLight:"$red200",errorLightHover:"$red300",errorLightActive:"$red400",errorLightContrast:"$red600",error:"$red600",errorBorder:"$red500",errorBorderHover:"$red600",errorSolidHover:"$red700",errorSolidContrast:"$white",errorShadow:"$red500",neutralLight:"$gray100",neutralLightHover:"$gray200",neutralLightActive:"$gray300",neutralLightContrast:"$gray800",neutral:"$gray600",neutralBorder:"$gray400",neutralBorderHover:"$gray500",neutralSolidHover:"$gray600",neutralSolidContrast:"$white",neutralShadow:"$gray400",gradient:"linear-gradient(112deg, $cyan600 -63.59%, $pink600 -20.3%, $blue600 70.46%)",accents0:"$gray50",accents1:"$gray100",accents2:"$gray200",accents3:"$gray300",accents4:"$gray400",accents5:"$gray500",accents6:"$gray600",accents7:"$gray700",accents8:"$gray800",accents9:"$gray900",border:"$gray300"};export const defaultMedia={xs:`(min-width: ${defaultTokens.breakpoints.xs})`,sm:`(min-width: ${defaultTokens.breakpoints.sm})`,md:`(min-width: ${defaultTokens.breakpoints.md})`,lg:`(min-width: ${defaultTokens.breakpoints.lg})`,xl:`(min-width: ${defaultTokens.breakpoints.xl})`,xsMax:`(max-width: ${defaultTokens.breakpoints.xs})`,smMax:`(max-width: ${defaultTokens.breakpoints.sm})`,mdMax:`(max-width: ${defaultTokens.breakpoints.md})`,lgMax:`(max-width: ${defaultTokens.breakpoints.lg})`,xlMax:`(max-width: ${defaultTokens.breakpoints.xl})`,motion:"(prefers-reduced-motion: reduce)",safari:"not all and (min-resolution:.001dpcm)",hover:"(any-hover: hover)",dark:"(prefers-color-scheme: dark)",light:"(prefers-color-scheme: light)"};export const defaultUtils={p:e=>({padding:e}),pt:e=>({paddingTop:e}),pr:e=>({paddingRight:e}),pb:e=>({paddingBottom:e}),pl:e=>({paddingLeft:e}),px:e=>({paddingLeft:e,paddingRight:e}),py:e=>({paddingTop:e,paddingBottom:e}),m:e=>({margin:e}),mt:e=>({marginTop:e}),mr:e=>({marginRight:e}),mb:e=>({marginBottom:e}),ml:e=>({marginLeft:e}),mx:e=>({marginLeft:e,marginRight:e}),my:e=>({marginTop:e,marginBottom:e}),ta:e=>({textAlign:e}),tt:e=>({textTransform:e}),to:e=>({textOverflow:e}),d:e=>({display:e}),dflex:e=>({display:"flex",alignItems:e,justifyContent:e}),fd:e=>({flexDirection:e}),fw:e=>({flexWrap:e}),ai:e=>({alignItems:e}),ac:e=>({alignContent:e}),jc:e=>({justifyContent:e}),as:e=>({alignSelf:e}),fg:e=>({flexGrow:e}),fs:e=>({fontSize:e}),fb:e=>({flexBasis:e}),bc:e=>({backgroundColor:e}),bf:e=>({backdropFilter:e}),bg:e=>({background:e}),bgBlur:e=>({bf:"saturate(180%) blur(10px)",bg:e}),bgColor:e=>({backgroundColor:e}),backgroundClip:e=>({WebkitBackgroundClip:e,backgroundClip:e}),bgClip:e=>({WebkitBackgroundClip:e,backgroundClip:e}),br:e=>({borderRadius:e}),bw:e=>({borderWidth:e}),btrr:e=>({borderTopRightRadius:e}),bbrr:e=>({borderBottomRightRadius:e}),bblr:e=>({borderBottomLeftRadius:e}),btlr:e=>({borderTopLeftRadius:e}),bs:e=>({boxShadow:e}),ds:e=>({dropShadow:e}),shadow:e=>({boxShadow:e}),dshadow:e=>({dropShadow:e}),dropShadow:e=>({filter:`$dropShadows${e}`}),normalShadow:e=>({boxShadow:`0 4px 14px 0 $colors${e}`}),normalShadowVar:e=>({boxShadow:`0 4px 14px 0 ${e}`}),lh:e=>({lineHeight:e}),ov:e=>({overflow:e}),ox:e=>({overflowX:e}),oy:e=>({overflowY:e}),pe:e=>({pointerEvents:e}),events:e=>({pointerEvents:e}),us:e=>({WebkitUserSelect:e,userSelect:e}),userSelect:e=>({WebkitUserSelect:e,userSelect:e}),w:e=>({width:e}),h:e=>({height:e}),mw:e=>({maxWidth:e}),maxW:e=>({maxWidth:e}),mh:e=>({maxHeight:e}),maxH:e=>({maxHeight:e}),size:e=>({width:e,height:e}),minSize:e=>({minWidth:e,minHeight:e,width:e,height:e}),sizeMin:e=>({minWidth:e,minHeight:e,width:e,height:e}),maxSize:e=>({maxWidth:e,maxHeight:e}),sizeMax:e=>({maxWidth:e,maxHeight:e}),appearance:e=>({WebkitAppearance:e,appearance:e}),scale:e=>({transform:`scale(${e})`}),linearGradient:e=>({backgroundImage:`linear-gradient(${e})`}),tdl:e=>({textDecorationLine:e}),truncateText:e=>({maxWidth:e,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}),textGradient:e=>({backgroundImage:`linear-gradient(${e})`,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent","&::selection":{WebkitTextFillColor:"$colors$text"}})};export const defaultThemeMap={...e,width:"space",height:"space",minWidth:"space",maxWidth:"space",minHeight:"space",maxHeight:"space",flexBasis:"space",gridTemplateColumns:"space",gridTemplateRows:"space",blockSize:"space",minBlockSize:"space",maxBlockSize:"space",inlineSize:"space",minInlineSize:"space",maxInlineSize:"space",borderWidth:"borderWeights"};export default{prefix:"nextui",theme:{...defaultTokens,colors:defaultColors,shadows:{},dropShadows:{}},media:defaultMedia,utils:defaultUtils,themeMap:defaultThemeMap};
|
package/esm/theme/dark-theme.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{blueDark as r,greenDark as e,purpleDark as
|
|
1
|
+
import{blueDark as r,greenDark as e,purpleDark as p,yellowDark as o,redDark as g,cyanDark as t,pinkDark as a,grayDark as d}from"./colors";export default{colors:{background:"$black",foreground:"$white",backgroundContrast:"$accents0",...r,...p,...e,...o,...g,...t,...a,...d,primaryLight:"$blue50",primaryLightHover:"$blue100",primaryLightActive:"$blue200",primaryLightContrast:"$blue600",secondaryLight:"$purple50",secondaryLightHover:"$purple100",secondaryLightActive:"$purple200",secondaryLightContrast:"$purple800",secondary:"$purple700",secondaryBorder:"$purple500",secondaryBorderHover:"$purple600",secondarySolidHover:"$purple700",secondaryShadow:"$purple500",successLight:"$green50",successLightHover:"$green100",successLightActive:"$green200",warningLight:"$yellow50",warningLightHover:"$yellow100",warningLightActive:"$yellow200",errorLight:"$red50",errorLightHover:"$red100",errorLightActive:"$red200",errorLightContrast:"$red700",neutralLight:"$gray200",neutralLightHover:"$gray300",neutralLightActive:"$gray400",neutralSolidContrast:"$white",text:"$gray900",link:"$blue700",codeLight:"$cyan50",code:"$cyan600",selection:"$pink800"},shadows:{xs:"0 2px 8px 1px rgb(0 0 0 / 0.07), 0 1px 1px -1px rgb(0 0 0 / 0.04)",sm:"0 2px 8px 2px rgb(0 0 0 / 0.07), 0 2px 4px -1px rgb(0 0 0 / 0.04)",md:"0 12px 20px 6px rgb(0 0 0 / 0.08)",lg:"0 12px 34px 6px rgb(0 0 0 / 0.18)",xl:"0 25px 65px 0px rgb(0 0 0 / 0.35)"},dropShadows:{xs:"drop-shadow(0 2px 4px rgb(0 0 0 / 0.07)) drop-shadow(0 1px 1px rgb(0 0 0 / 0.04))",sm:"drop-shadow(0 2px 8px rgb(0 0 0 / 0.07)) drop-shadow(0 2px 4px rgb(0 0 0 / 0.04))",md:"drop-shadow(0 4px 12px rgb(0 0 0 / 0.08)) drop-shadow(0 20px 8px rgb(0 0 0 / 0.04))",lg:"drop-shadow(0 12px 24px rgb(0 0 0 / 0.15)) drop-shadow(0 12px 14px rgb(0 0 0 / 0.1))",xl:"drop-shadow(0 25px 34px rgb(0 0 0 / 0.35))"}};
|
package/esm/theme/light-theme.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{blue as
|
|
1
|
+
import{blue as p,purple as x,green as r,yellow as o,red as d,cyan as g,pink as b,gray as s}from"./colors";export default{colors:{background:"$white",foreground:"$black",backgroundContrast:"$white",...p,...x,...r,...o,...d,...g,...b,...s,text:"$gray900",link:"$blue600",codeLight:"$pink100",code:"$pink600",selection:"$blue200"},shadows:{xs:"0 2px 8px 1px rgb(104 112 118 / 0.07), 0 1px 1px -1px rgb(104 112 118 / 0.04)",sm:"0 2px 8px 2px rgb(104 112 118 / 0.07), 0 2px 4px -1px rgb(104 112 118 / 0.04)",md:"0 12px 20px 6px rgb(104 112 118 / 0.08)",lg:"0 12px 34px 6px rgb(104 112 118 / 0.18)",xl:"0 25px 65px 0px rgb(104 112 118 / 0.35)"},dropShadows:{xs:"drop-shadow(0 2px 4px rgb(104 112 118 / 0.07)) drop-shadow(0 1px 1px rgb(104 112 118 / 0.04))",sm:"drop-shadow(0 2px 8px rgb(104 112 118 / 0.07)) drop-shadow(0 2px 4px rgb(104 112 118 / 0.04))",md:"drop-shadow(0 4px 12px rgb(104 112 118 / 0.08)) drop-shadow(0 20px 8px rgb(104 112 118 / 0.04))",lg:"drop-shadow(0 12px 24px rgb(104 112 118 / 0.15)) drop-shadow(0 12px 14px rgb(104 112 118 / 0.1))",xl:"drop-shadow(0 25px 34px rgb(104 112 118 / 0.35))"}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{css as o}from"./stitches.config";export const sharedFocus=o({WebkitTapHighlightColor:"transparent","&:focus:not(&:focus-visible)":{boxShadow:"none"},"&:focus":{outline:"none",boxShadow:"0 0 0 2px $colors$background, 0 0 0 4px $colors$primary"},"@safari":{WebkitTapHighlightColor:"transparent",outline:"none"}});export const cssFocusVisible=o({variants:{isFocusVisible:{true:{outline:"transparent solid 2px",outlineOffset:"2px",boxShadow:"0 0 0 2px $colors$background, 0 0 0 4px $colors$primary"},false:{outline:"none"}}}});export const cssNoBlurriness=o({transform:"translateZ(0)",backfaceVisibility:"hidden"});export const sharedVisuallyHidden=o({border:"0px",clip:"rect(0px, 0px, 0px, 0px)",height:"1px",width:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"});export const sharedDialogPopup=o({'&[aria-haspopup="true"]&[aria-expanded="true"]':{opacity:.7,transform:"scale(0.97)"}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createStitches as e}from"@stitches/react";import
|
|
1
|
+
import{createStitches as e}from"@stitches/react";import t from"./common";import o from"./light-theme";import s from"./dark-theme";import r from"../utils/deep-merge";export const getStitchesTheme=e=>r(e,t.theme);const m=e({...t,theme:{...t.theme,shadows:{...o.shadows},dropShadows:{...o.dropShadows},colors:{...t.theme.colors,...o.colors}}});export const createThemeBase=m.createTheme;export const styled=m.styled;export const css=m.css;export const globalCss=m.globalCss;export const keyframes=m.keyframes;export const getCssText=m.getCssText;export const theme=m.theme;export const config=m.config;export const createTheme=({type:e,theme:t,className:m})=>{if(!e)throw new Error("Theme type is required");return createThemeBase(m||`${e}-theme`,r("dark"===e?s:o,t))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{styled as o}from"../theme/stitches.config";export const StyledTooltipTrigger=o("div",{width:"max-content",display:"inherit"});export const StyledTooltipArrow=o("span",{display:"none",content:"",size:"$5",zIndex:"-2",background:"$$tooltipColor",br:"0px 0px 2px 0px",position:"absolute"});export const StyledTooltip=o("div",{position:"relative",fs:"$
|
|
1
|
+
import{styled as o}from"../theme/stitches.config";export const StyledTooltipTrigger=o("div",{width:"max-content",display:"inherit"});export const StyledTooltipArrow=o("span",{display:"none",content:"",size:"$5",zIndex:"-2",background:"$$tooltipColor",br:"0px 0px 2px 0px",position:"absolute"});export const StyledTooltip=o("div",{position:"relative",fs:"$sm",padding:0,variants:{hideArrow:{false:{[`& ${StyledTooltipArrow}`]:{display:"block"}}}}});export const StyledTooltipContent=o("div",{position:"absolute",width:"auto",padding:"$3 $sm",opacity:0,zIndex:"$10",br:"$lg","@motion":{transition:"none"},variants:{color:{default:{$$tooltipColor:"$colors$background",bg:"$$tooltipColor"},primary:{$$tooltipColor:"$colors$primary",bg:"$$tooltipColor"},secondary:{$$tooltipColor:"$colors$secondary",bg:"$$tooltipColor"},success:{$$tooltipColor:"$colors$success",bg:"$$tooltipColor"},warning:{$$tooltipColor:"$colors$warning",bg:"$$tooltipColor"},error:{$$tooltipColor:"$colors$error",bg:"$$tooltipColor"},invert:{$$tooltipColor:"$colors$foreground",bg:"$$tooltipColor"}},contentColor:{default:{$$tooltipTextColor:"$colors$text",color:"$$tooltipTextColor"},primary:{$$tooltipTextColor:"$colors$primary",color:"$$tooltipTextColor"},secondary:{$$tooltipTextColor:"$colors$secondary",color:"$$tooltipTextColor"},success:{$$tooltipTextColor:"$colors$success",color:"$$tooltipTextColor"},warning:{$$tooltipTextColor:"$colors$warning",color:"$$tooltipTextColor"},error:{$$tooltipTextColor:"$colors$error",color:"$$tooltipTextColor"},invert:{$$tooltipTextColor:"$colors$invert",color:"$$tooltipTextColor"}},rounded:{true:{br:"$pill"}},shadow:{true:{bs:"$md"}},animated:{true:{transition:"opacity 0.25s ease 0s, top 0.25s ease 0s"},false:{transition:"none"}}},compoundVariants:[{color:"primary",contentColor:"default",css:{$$tooltipTextColor:"$colors$white"}},{color:"secondary",contentColor:"default",css:{$$tooltipTextColor:"$colors$white"}},{color:"success",contentColor:"default",css:{$$tooltipTextColor:"$colors$white"}},{color:"error",contentColor:"default",css:{$$tooltipTextColor:"$colors$white"}},{color:"invert",contentColor:"default",css:{$$tooltipTextColor:"$colors$background"}}],defaultVariants:{color:"default",contentColor:"default"}});
|
package/esm/user/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./user";import r from"./user-link";e.Link=r;export{StyledUser,StyledUserInfo,StyledUserName,StyledUserDesc
|
|
1
|
+
import e from"./user";import r from"./user-link";e.Link=r;export{StyledUser,StyledUserInfo,StyledUserName,StyledUserDesc}from"./user.styles";export default e;
|
package/esm/user/user-link.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import r from"react";import e from"../link";import
|
|
1
|
+
import r from"react";import e from"../link";import t from"../utils/clsx";import{__DEV__ as o}from"../utils/assertion";import{jsx as i}from"react/jsx-runtime";const s=r.forwardRef(((r,o)=>{const{rel:s="noopener",color:n="primary",target:l="_blank",className:m,children:a,...c}=r;return i(e,{ref:o,rel:s,color:n,target:l,className:t("nextui-user-link",m),...c,children:a})}));o&&(s.displayName="NextUI.UserLink"),s.toString=()=>".nextui-user-link";const n=r.memo(s);export default n;
|
package/esm/user/user.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r from"react";import{Avatar as e}from"../index";import{useFocusRing as s}from"@react-aria/focus";import{mergeProps as o}from"@react-aria/utils";import{useDOMRef as t}from"../utils/dom";import{__DEV__ as i}from"../utils/assertion";import{StyledUser as a,StyledUserInfo as n,StyledUserName as c,StyledUserDesc as m}from"./user.styles";import{jsx as u}from"react/jsx-runtime";import{jsxs as d}from"react/jsx-runtime";export const User=r.forwardRef(((r,i)=>{const{as:l,css:p,src:x,text:f,name:b,children:N,altText:U,color:h,squared:j,bordered:z,size:g,description:q,zoomed:y,pointer:F,...R}=r,V=t(i),{isFocusVisible:k,focusProps:v}=s();return d(a,{ref:V,as:l,...o(R,v),css:o("button"===l?{borderRadius:"$xs",background:"none",appearance:"none",p:0,m:0,outline:"none",border:"none",cursor:"pointer"}:{},p),isFocusVisible:k,children:[u(e,{className:"nextui-user-avatar",src:x,color:h,squared:j,zoomed:y,pointer:F,bordered:z,text:f,size:g,alt:U}),d(n,{className:"nextui-user-info",children:[u(c,{className:"nextui-user-name",children:b}),u(m,{className:"nextui-user-desc",children:q||N})]})]})}));i&&(User.displayName="NextUI.User"),User.toString=()=>".nextui-user";export default User;
|
package/esm/user/user.styles.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{styled as e}from"../theme/stitches.config";export const StyledUser=e("div",{d:"inline-flex",p:"0 $sm",jc:"center",ai:"center",w:"max-content",maxWidth:"100%"});export const StyledUserInfo=e("div",{ml:"$sm",d:"inline-flex",fd:"column",whiteSpace:"nowrap"});export const StyledUserName=e("span",{fontSize:"$
|
|
1
|
+
import{styled as e}from"../theme/stitches.config";import{cssFocusVisible as t,sharedDialogPopup as s,cssNoBlurriness as o}from"../theme/shared-css";export const StyledUser=e("div",{d:"inline-flex",p:"0 $sm",jc:"center",ai:"center",w:"max-content",maxWidth:"100%",transition:"transform 250ms ease 0ms, box-shadow 0.25s ease 0s","@motion":{transition:"none"}},t,o,s);export const StyledUserInfo=e("div",{ml:"$sm",d:"inline-flex",fd:"column",alignItems:"flex-start",whiteSpace:"nowrap"});export const StyledUserName=e("span",{fontSize:"$sm",color:"$text",lh:"$sm",tt:"capitalize",fontWeight:"$medium",maxW:"$60",to:"ellipsis",ov:"hidden"});export const StyledUserDesc=e("span",{fontSize:"$xs",color:"$accents7","*:first-child":{mt:0},"*:last-child":{mb:0}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"react";import{styled as r,keyframes as e}from"../theme/stitches.config";import s from"./clsx";import{__DEV__ as o}from"./assertion";import{jsx as i}from"react/jsx-runtime";export const stroke=e({"100%":{strokeDashoffset:0}});const a=r("svg",{d:"block",path:{transformOrigin:"50% 50%",strokeDasharray:48,strokeDashoffset:48,animation:`${stroke} .25s cubic-bezier(0.650, 0.000, 0.450, 1.000) forwards`}}),c=t=>{const{width:r=24,height:e=24,size:o,strokeWidth:c=3,fill:m="currentColor",css:h,className:n}=t;return i(a,{role:"img",width:o||r,height:o||e,className:s("nextui-checkmark",n),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 52 52",css:{...h},children:i("path",{stroke:m,strokeWidth:c,fill:"none",d:"M14.1 27.2l7.1 7.2 16.7-16.8"})})};o&&(c.displayName="NextUI.Checkmark"),c.toString=()=>".nextui-checkmark";export default c;
|
package/esm/utils/color.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{normalColors as t}from"./prop-types";export const getCssVar=t=>{if("undefined"!=typeof document||!t){const r=isCssVar(t)?t.replace("var(","").replace(")",""):`--${t}`;return getComputedStyle(document.documentElement).getPropertyValue(r)}return""};export const isCssVar=t=>!(!t||0!==(null==t?void 0:t.indexOf("var(")));export const isHex=t=>/#[a-fA-F0-9]{3,6}/g.test(t);export const hexToRGBA=(t,r=1)=>{let e=0,o=0,n=0;return 4==t.length?(e="0x"+t[1]+t[1],o="0x"+t[2]+t[2],n="0x"+t[3]+t[3]):7==t.length&&(e="0x"+t[1]+t[2],o="0x"+t[3]+t[4],n="0x"+t[5]+t[6]),`rgba(${+e}, ${+o},${+n},${r})`};export const isNormalColor=r=>{let e=t.find((t=>t===r));return null!=e};export const isColor=t=>{let r=(new Option).style;return r.color=t,r.color==t};export const hexToRgb=t=>{const r=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,((t,r,e,o)=>`${r}${r}${e}${e}${o}${o}`)),e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r);if(!e)throw new Error(`Next UI: Unsupported ${t} color.`);return[Number.parseInt(e[1],16),Number.parseInt(e[2],16),Number.parseInt(e[3],16)]};export const hexFromString=(t,r="",e=!1)=>{const o=t.match(/#[a-fA-F0-9]{6}|#[a-fA-F0-9]{3}$/g);return o&&o.length>0?e?o[o.length-1]:o:r};export const colorToRgbValues=t=>{const r=isCssVar(t)?getCssVar(t):t;if("#"===r.charAt(0))return hexToRgb(r);const e=r.replace(/ /g,""),o=r.substr(0,4),n=e.match(/\((.+)\)/);if(!o.startsWith("rgb")||!n)throw new Error('Next UI: Only support ["RGB", "RGBA", "HEX"] color.');return n[1].split(",").map((t=>Number.parseFloat(t)))};export const addColorAlpha=(t,r=1)=>{if(!t)return"";const e=isCssVar(t)?getCssVar(t):t;if(/#[a-fA-F0-9]{3,6}/g.test(e))return hexToRGBA(e,r);if(!/^#|rgb|RGB/.test(e))return e;const[o,n,s]=colorToRgbValues(e);return`rgba(${o}, ${n}, ${s}, ${r>1?1:r<0?0:r})`};function
|
|
1
|
+
import{normalColors as t,simpleColors as r}from"./prop-types";export const getCssVar=t=>{if("undefined"!=typeof document||!t){const r=isCssVar(t)?t.replace("var(","").replace(")",""):`--${t}`;return getComputedStyle(document.documentElement).getPropertyValue(r)}return""};export const isCssVar=t=>!(!t||0!==(null==t?void 0:t.indexOf("var(")));export const isHex=t=>/#[a-fA-F0-9]{3,6}/g.test(t);export const hexToRGBA=(t,r=1)=>{let e=0,o=0,n=0;return 4==t.length?(e="0x"+t[1]+t[1],o="0x"+t[2]+t[2],n="0x"+t[3]+t[3]):7==t.length&&(e="0x"+t[1]+t[2],o="0x"+t[3]+t[4],n="0x"+t[5]+t[6]),`rgba(${+e}, ${+o},${+n},${r})`};export const isNormalColor=r=>{let e=t.find((t=>t===r));return null!=e};export const isSimpleColor=t=>{let e=r.find((r=>r===t));return null!=e};export const isColor=t=>{let r=(new Option).style;return r.color=t,r.color==t};export const hexToRgb=t=>{const r=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,((t,r,e,o)=>`${r}${r}${e}${e}${o}${o}`)),e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r);if(!e)throw new Error(`Next UI: Unsupported ${t} color.`);return[Number.parseInt(e[1],16),Number.parseInt(e[2],16),Number.parseInt(e[3],16)]};export const hexFromString=(t,r="",e=!1)=>{const o=t.match(/#[a-fA-F0-9]{6}|#[a-fA-F0-9]{3}$/g);return o&&o.length>0?e?o[o.length-1]:o:r};export const colorToRgbValues=t=>{const r=isCssVar(t)?getCssVar(t):t;if("#"===r.charAt(0))return hexToRgb(r);const e=r.replace(/ /g,""),o=r.substr(0,4),n=e.match(/\((.+)\)/);if(!o.startsWith("rgb")||!n)throw new Error('Next UI: Only support ["RGB", "RGBA", "HEX"] color.');return n[1].split(",").map((t=>Number.parseFloat(t)))};export const addColorAlpha=(t,r=1)=>{if(!t)return"";const e=isCssVar(t)?getCssVar(t):t;if(/#[a-fA-F0-9]{3,6}/g.test(e))return hexToRGBA(e,r);if(!/^#|rgb|RGB/.test(e))return e;const[o,n,s]=colorToRgbValues(e);return`rgba(${o}, ${n}, ${s}, ${r>1?1:r<0?0:r})`};function e(t,r){return r=r||2,(new Array(r).join("0")+t).slice(-r)}export const invertHex=(t,r=!0)=>{let o=isCssVar(t)?getCssVar(t):t;if(0===o.indexOf("#")&&(o=o.slice(1)),3===o.length&&(o=o[0]+o[0]+o[1]+o[1]+o[2]+o[2]),6!==o.length)return t;let n=parseInt(o.slice(0,2),16),s=parseInt(o.slice(2,4),16),l=parseInt(o.slice(4,6),16);return r?.299*n+.587*s+.114*l>186?"#000000":"#FFFFFF":(n=255-n,s=255-s,l=255-l,"#"+e(n.toString(16))+e(s.toString(16))+e(l.toString(16)))};
|