@tryghost/shade 0.1.0-alpha.54 → 0.1.0-alpha.55

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.
@@ -22,7 +22,7 @@ var SettingGroupHeader = React$1.forwardRef(({ className, ...props }, ref) => /*
22
22
  ref,
23
23
  align: "start",
24
24
  as: "div",
25
- className: cn("relative z-10 w-full", className),
25
+ className: cn("relative z-10 w-full in-data-[admin7-mobile=true]:max-sm:grid in-data-[admin7-mobile=true]:max-sm:grid-cols-[minmax(0,1fr)_auto] in-data-[admin7-mobile=true]:max-sm:items-center in-data-[admin7-mobile=true]:max-sm:gap-y-2.5", className),
26
26
  gap: "lg",
27
27
  justify: "between",
28
28
  ...props
@@ -30,7 +30,7 @@ var SettingGroupHeader = React$1.forwardRef(({ className, ...props }, ref) => /*
30
30
  SettingGroupHeader.displayName = "SettingGroupHeader";
31
31
  var SettingGroupDetails = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Stack, {
32
32
  ref,
33
- className: cn("min-w-0", className),
33
+ className: cn("min-w-0 in-data-[admin7-mobile=true]:max-sm:contents", className),
34
34
  gap: "xs",
35
35
  ...props
36
36
  }));
@@ -38,7 +38,7 @@ SettingGroupDetails.displayName = "SettingGroupDetails";
38
38
  var SettingGroupTitle = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Text, {
39
39
  ref,
40
40
  as: "h5",
41
- className: cn("section-heading settings-heading md:text-lg", className),
41
+ className: cn("section-heading settings-heading in-data-[admin7-mobile=true]:max-sm:col-start-1 in-data-[admin7-mobile=true]:max-sm:row-start-1 md:text-lg", className),
42
42
  leading: "supertight",
43
43
  weight: "semibold",
44
44
  ...props
@@ -46,13 +46,13 @@ var SettingGroupTitle = React$1.forwardRef(({ className, ...props }, ref) => /*
46
46
  SettingGroupTitle.displayName = "SettingGroupTitle";
47
47
  var SettingGroupDescription = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Text, {
48
48
  ref,
49
- className: cn("mr-5 hidden text-pretty group-data-[editing=false]/setting-group:block in-data-[admin7-design=true]:text-muted-foreground md:block", className),
49
+ className: cn("mr-5 hidden text-pretty group-data-[editing=false]/setting-group:block in-data-[admin7-design=true]:text-muted-foreground in-data-[admin7-mobile=true]:max-sm:col-span-full in-data-[admin7-mobile=true]:max-sm:row-start-2 in-data-[admin7-mobile=true]:max-sm:mr-0 md:block", className),
50
50
  ...props
51
51
  }));
52
52
  SettingGroupDescription.displayName = "SettingGroupDescription";
53
53
  var SettingGroupActions = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", {
54
54
  ref,
55
- className: cn("shrink-0 [&_button]:text-control!", className),
55
+ className: cn("shrink-0 in-data-[admin7-mobile=true]:max-sm:col-start-2 in-data-[admin7-mobile=true]:max-sm:row-start-1 in-data-[admin7-mobile=true]:max-sm:-my-1.25 in-data-[admin7-mobile=true]:max-sm:[&_[data-variant=ghost]]:mx-0 in-data-[admin7-mobile=true]:max-sm:[&_[data-variant=ghost]]:px-0 in-data-[admin7-mobile=true]:max-sm:[&_[data-variant=ghost]:hover]:bg-transparent [&_button]:text-control! in-data-[admin7-mobile=true]:max-sm:[&_button]:mt-0 in-data-[admin7-mobile=true]:max-sm:[&>*]:mt-0", className),
56
56
  ...props
57
57
  }));
58
58
  SettingGroupActions.displayName = "SettingGroupActions";
@@ -1 +1 @@
1
- {"version":3,"file":"setting-group.js","names":[],"sources":["../../../src/components/patterns/setting-group.tsx"],"sourcesContent":["import * as React from 'react';\nimport { type VariantProps } from 'class-variance-authority';\n\nimport { settingGroupVariants } from '@/components/patterns/setting-group-variants';\nimport { Grid } from '@/components/primitives/grid';\nimport { Inline } from '@/components/primitives/inline';\nimport { Stack } from '@/components/primitives/stack';\nimport { Text } from '@/components/primitives/text';\nimport { cn } from '@/lib/utils';\n\ninterface SettingGroupProps\n extends React.ComponentPropsWithoutRef<'div'>, VariantProps<typeof settingGroupVariants> {\n editing?: boolean;\n}\n\nconst SettingGroup = React.forwardRef<HTMLDivElement, SettingGroupProps>(\n ({ className, variant, highlighted, editing = false, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(settingGroupVariants({ variant, highlighted, className }))}\n data-editing={editing}\n {...props}\n />\n ),\n);\nSettingGroup.displayName = 'SettingGroup';\n\nconst SettingGroupHeader = React.forwardRef<\n HTMLElement,\n React.ComponentPropsWithoutRef<typeof Inline>\n>(({ className, ...props }, ref) => (\n <Inline\n ref={ref}\n align=\"start\"\n as=\"div\"\n className={cn('relative z-10 w-full', className)}\n gap=\"lg\"\n justify=\"between\"\n {...props}\n />\n));\nSettingGroupHeader.displayName = 'SettingGroupHeader';\n\nconst SettingGroupDetails = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof Stack>\n>(({ className, ...props }, ref) => (\n <Stack ref={ref} className={cn('min-w-0', className)} gap=\"xs\" {...props} />\n));\nSettingGroupDetails.displayName = 'SettingGroupDetails';\n\nconst SettingGroupTitle = React.forwardRef<\n HTMLElement,\n React.ComponentPropsWithoutRef<typeof Text>\n>(({ className, ...props }, ref) => (\n <Text\n ref={ref}\n as=\"h5\"\n className={cn('section-heading settings-heading md:text-lg', className)}\n leading=\"supertight\"\n weight=\"semibold\"\n {...props}\n />\n));\nSettingGroupTitle.displayName = 'SettingGroupTitle';\n\nconst SettingGroupDescription = React.forwardRef<\n HTMLElement,\n React.ComponentPropsWithoutRef<typeof Text>\n>(({ className, ...props }, ref) => (\n <Text\n ref={ref}\n className={cn(\n 'mr-5 hidden text-pretty group-data-[editing=false]/setting-group:block in-data-[admin7-design=true]:text-muted-foreground md:block',\n className,\n )}\n {...props}\n />\n));\nSettingGroupDescription.displayName = 'SettingGroupDescription';\n\nconst SettingGroupActions = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn('shrink-0 [&_button]:text-control!', className)} {...props} />\n ),\n);\nSettingGroupActions.displayName = 'SettingGroupActions';\n\ninterface SettingGroupContentProps extends React.ComponentPropsWithoutRef<'div'> {\n columns?: 1 | 2;\n}\n\nconst SettingGroupContent = React.forwardRef<HTMLDivElement, SettingGroupContentProps>(\n ({ children, className, columns = 1, ...props }, ref) => {\n if (columns === 2) {\n return (\n <Grid\n ref={ref}\n className={cn('grid-cols-1 gap-x-8 gap-y-6 md:grid-cols-2', className)}\n columns={1}\n gap=\"none\"\n {...props}\n >\n {children}\n </Grid>\n );\n }\n\n return (\n <Stack ref={ref} className={cn('gap-y-7', className)} gap=\"none\" {...props}>\n {children}\n </Stack>\n );\n },\n);\nSettingGroupContent.displayName = 'SettingGroupContent';\n\nconst SettingGroupValue = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof Stack>\n>(({ className, ...props }, ref) => (\n <Stack ref={ref} className={className} gap=\"none\" {...props} />\n));\nSettingGroupValue.displayName = 'SettingGroupValue';\n\nconst SettingGroupValueTitle = React.forwardRef<\n HTMLElement,\n React.ComponentPropsWithoutRef<typeof Text>\n>(({ className, ...props }, ref) => (\n <Text ref={ref} as=\"h6\" className={cn('text-base', className)} weight=\"semibold\" {...props} />\n));\nSettingGroupValueTitle.displayName = 'SettingGroupValueTitle';\n\nconst SettingGroupValueContent = React.forwardRef<\n HTMLElement,\n React.ComponentPropsWithoutRef<typeof Inline>\n>(({ className, ...props }, ref) => (\n <Inline ref={ref} as=\"div\" className={className} gap=\"none\" {...props} />\n));\nSettingGroupValueContent.displayName = 'SettingGroupValueContent';\n\nexport {\n SettingGroup,\n SettingGroupActions,\n SettingGroupContent,\n SettingGroupDescription,\n SettingGroupDetails,\n SettingGroupHeader,\n SettingGroupTitle,\n SettingGroupValue,\n SettingGroupValueContent,\n SettingGroupValueTitle,\n};\nexport type { SettingGroupContentProps, SettingGroupProps };\n"],"mappings":";;;;;;;;;AAeA,IAAM,eAAe,QAAM,YACxB,EAAE,WAAW,SAAS,aAAa,UAAU,OAAO,GAAG,S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ACT,KAAI;EACJ,GAAI;EAEH;CACG,CAAA;CAIV,OACE,oBAAC,OAAD;EAAY;EAAK,WAAW,GAAG,WAAW,SAAS;EAAG,KAAI;EAAO,GAAI;EAClE;CACI,CAAA;AAEX,CACF;AACA,oBAAoB,cAAc;AAElC,IAAM,oBAAoB,QAAM,YAG7B,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,OAAD;CAAY;CAAgB;CAAW,KAAI;CAAO,GAAI;AAAQ,CAAA,CAC/D;AACD,kBAAkB,cAAc;AAEhC,IAAM,yBAAyB,QAAM,YAGlC,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,MAAD;CAAW;CAAK,IAAG;CAAK,WAAW,GAAG,aAAa,SAAS;CAAG,QAAO;CAAW,GAAI;AAAQ,CAAA,CAC9F;AACD,uBAAuB,cAAc;AAErC,IAAM,2BAA2B,QAAM,YAGpC,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,QAAD;CAAa;CAAK,IAAG;CAAiB;CAAW,KAAI;CAAO,GAAI;AAAQ,CAAA,CACzE;AACD,yBAAyB,cAAc"}
1
+ {"version":3,"file":"setting-group.js","names":[],"sources":["../../../src/components/patterns/setting-group.tsx"],"sourcesContent":["import * as React from 'react';\nimport { type VariantProps } from 'class-variance-authority';\n\nimport { settingGroupVariants } from '@/components/patterns/setting-group-variants';\nimport { Grid } from '@/components/primitives/grid';\nimport { Inline } from '@/components/primitives/inline';\nimport { Stack } from '@/components/primitives/stack';\nimport { Text } from '@/components/primitives/text';\nimport { cn } from '@/lib/utils';\n\ninterface SettingGroupProps\n extends React.ComponentPropsWithoutRef<'div'>, VariantProps<typeof settingGroupVariants> {\n editing?: boolean;\n}\n\nconst SettingGroup = React.forwardRef<HTMLDivElement, SettingGroupProps>(\n ({ className, variant, highlighted, editing = false, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(settingGroupVariants({ variant, highlighted, className }))}\n data-editing={editing}\n {...props}\n />\n ),\n);\nSettingGroup.displayName = 'SettingGroup';\n\nconst SettingGroupHeader = React.forwardRef<\n HTMLElement,\n React.ComponentPropsWithoutRef<typeof Inline>\n>(({ className, ...props }, ref) => (\n <Inline\n ref={ref}\n align=\"start\"\n as=\"div\"\n className={cn(\n 'relative z-10 w-full in-data-[admin7-mobile=true]:max-sm:grid in-data-[admin7-mobile=true]:max-sm:grid-cols-[minmax(0,1fr)_auto] in-data-[admin7-mobile=true]:max-sm:items-center in-data-[admin7-mobile=true]:max-sm:gap-y-2.5',\n className,\n )}\n gap=\"lg\"\n justify=\"between\"\n {...props}\n />\n));\nSettingGroupHeader.displayName = 'SettingGroupHeader';\n\nconst SettingGroupDetails = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof Stack>\n>(({ className, ...props }, ref) => (\n <Stack\n ref={ref}\n className={cn('min-w-0 in-data-[admin7-mobile=true]:max-sm:contents', className)}\n gap=\"xs\"\n {...props}\n />\n));\nSettingGroupDetails.displayName = 'SettingGroupDetails';\n\nconst SettingGroupTitle = React.forwardRef<\n HTMLElement,\n React.ComponentPropsWithoutRef<typeof Text>\n>(({ className, ...props }, ref) => (\n <Text\n ref={ref}\n as=\"h5\"\n className={cn(\n 'section-heading settings-heading in-data-[admin7-mobile=true]:max-sm:col-start-1 in-data-[admin7-mobile=true]:max-sm:row-start-1 md:text-lg',\n className,\n )}\n leading=\"supertight\"\n weight=\"semibold\"\n {...props}\n />\n));\nSettingGroupTitle.displayName = 'SettingGroupTitle';\n\nconst SettingGroupDescription = React.forwardRef<\n HTMLElement,\n React.ComponentPropsWithoutRef<typeof Text>\n>(({ className, ...props }, ref) => (\n <Text\n ref={ref}\n className={cn(\n 'mr-5 hidden text-pretty group-data-[editing=false]/setting-group:block in-data-[admin7-design=true]:text-muted-foreground in-data-[admin7-mobile=true]:max-sm:col-span-full in-data-[admin7-mobile=true]:max-sm:row-start-2 in-data-[admin7-mobile=true]:max-sm:mr-0 md:block',\n className,\n )}\n {...props}\n />\n));\nSettingGroupDescription.displayName = 'SettingGroupDescription';\n\nconst SettingGroupActions = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'shrink-0 in-data-[admin7-mobile=true]:max-sm:col-start-2 in-data-[admin7-mobile=true]:max-sm:row-start-1 in-data-[admin7-mobile=true]:max-sm:-my-1.25 in-data-[admin7-mobile=true]:max-sm:[&_[data-variant=ghost]]:mx-0 in-data-[admin7-mobile=true]:max-sm:[&_[data-variant=ghost]]:px-0 in-data-[admin7-mobile=true]:max-sm:[&_[data-variant=ghost]:hover]:bg-transparent [&_button]:text-control! in-data-[admin7-mobile=true]:max-sm:[&_button]:mt-0 in-data-[admin7-mobile=true]:max-sm:[&>*]:mt-0',\n className,\n )}\n {...props}\n />\n ),\n);\nSettingGroupActions.displayName = 'SettingGroupActions';\n\ninterface SettingGroupContentProps extends React.ComponentPropsWithoutRef<'div'> {\n columns?: 1 | 2;\n}\n\nconst SettingGroupContent = React.forwardRef<HTMLDivElement, SettingGroupContentProps>(\n ({ children, className, columns = 1, ...props }, ref) => {\n if (columns === 2) {\n return (\n <Grid\n ref={ref}\n className={cn('grid-cols-1 gap-x-8 gap-y-6 md:grid-cols-2', className)}\n columns={1}\n gap=\"none\"\n {...props}\n >\n {children}\n </Grid>\n );\n }\n\n return (\n <Stack ref={ref} className={cn('gap-y-7', className)} gap=\"none\" {...props}>\n {children}\n </Stack>\n );\n },\n);\nSettingGroupContent.displayName = 'SettingGroupContent';\n\nconst SettingGroupValue = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof Stack>\n>(({ className, ...props }, ref) => (\n <Stack ref={ref} className={className} gap=\"none\" {...props} />\n));\nSettingGroupValue.displayName = 'SettingGroupValue';\n\nconst SettingGroupValueTitle = React.forwardRef<\n HTMLElement,\n React.ComponentPropsWithoutRef<typeof Text>\n>(({ className, ...props }, ref) => (\n <Text ref={ref} as=\"h6\" className={cn('text-base', className)} weight=\"semibold\" {...props} />\n));\nSettingGroupValueTitle.displayName = 'SettingGroupValueTitle';\n\nconst SettingGroupValueContent = React.forwardRef<\n HTMLElement,\n React.ComponentPropsWithoutRef<typeof Inline>\n>(({ className, ...props }, ref) => (\n <Inline ref={ref} as=\"div\" className={className} gap=\"none\" {...props} />\n));\nSettingGroupValueContent.displayName = 'SettingGroupValueContent';\n\nexport {\n SettingGroup,\n SettingGroupActions,\n SettingGroupContent,\n SettingGroupDescription,\n SettingGroupDetails,\n SettingGroupHeader,\n SettingGroupTitle,\n SettingGroupValue,\n SettingGroupValueContent,\n SettingGroupValueTitle,\n};\nexport type { SettingGroupContentProps, SettingGroupProps };\n"],"mappings":";;;;;;;;;AAeA,IAAM,eAAe,QAAM,YACxB,EAAE,WAAW,SAAS,aAAa,UAAU,OAAO,GAAG,SAAS,QAC/D,oBAAC,OAAD;CACO;CACL,WAAW,GAAG,qBAAqB;EAAE;EAAS;EAAa;CAAU,CAAC,CAAC;CACvE,gBAAc;CACd,GAAI;AACL,CAAA,CAEL;AACA,aAAa,cAAc;AAE3B,IAAM,qBAAqB,QAAM,YAG9B,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,QAAD;CACO;CACL,OAAM;CACN,IAAG;CACH,WAAW,GACT,mOACA,SACF;CACA,KAAI;CACJ,SAAQ;CACR,GAAI;AACL,CAAA,CACF;AACD,mBAAmB,cAAc;AAEjC,IAAM,sBAAsB,QAAM,YAG/B,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,OAAD;CACO;CACL,WAAW,GAAG,wDAAwD,SAAS;CAC/E,KAAI;CACJ,GAAI;AACL,CAAA,CACF;AACD,oBAAoB,cAAc;AAElC,IAAM,oBAAoB,QAAM,YAG7B,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,MAAD;CACO;CACL,IAAG;CACH,WAAW,GACT,+IACA,SACF;CACA,SAAQ;CACR,QAAO;CACP,GAAI;AACL,CAAA,CACF;AACD,kBAAkB,cAAc;AAE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  disabled: isLoading || disabled,
29
29
  ...props,
30
30
  "data-control-shape": resolvedShape,
31
+ "data-variant": variant ?? "default",
31
32
  children: isLoading ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
32
33
  className: "inline-flex items-center justify-center gap-1.5 opacity-0",
33
34
  children: content
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","names":[],"sources":["../../../src/components/ui/button.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { type VariantProps } from 'class-variance-authority';\nimport { ChevronDown } from 'lucide-react';\n\nimport { buttonVariants } from '@/components/ui/button-variants';\nimport { LoadingIndicator } from '@/components/ui/loading-indicator';\nimport { cn } from '@/lib/utils';\nimport { useShade } from '@/providers/shade-context';\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n /**\n * Disables the button and shows a spinner over its label. The label stays in\n * the layout, so the button keeps its width. Ignored with `asChild`.\n */\n loading?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n shape,\n asChild = false,\n loading = false,\n disabled,\n children,\n ...props\n },\n ref,\n ) => {\n const { controlShape } = useShade();\n const Comp = asChild ? Slot : 'button';\n const isLoading = loading && !asChild;\n const resolvedShape = variant === 'link' ? 'rounded' : (shape ?? controlShape);\n const content =\n variant === 'dropdown' ? (\n <>\n {children}\n <ChevronDown\n className=\"-mr-0.5! -ml-1! size-4 stroke-[2px]! opacity-50\"\n strokeWidth={2}\n />\n </>\n ) : (\n children\n );\n\n return (\n <Comp\n ref={ref}\n aria-busy={isLoading || undefined}\n className={cn(\n isLoading && 'relative',\n buttonVariants({ variant, size, shape: resolvedShape, className }),\n )}\n disabled={isLoading || disabled}\n {...props}\n data-control-shape={resolvedShape}\n >\n {isLoading ? (\n <>\n <span className=\"inline-flex items-center justify-center gap-1.5 opacity-0\">\n {content}\n </span>\n <span className=\"absolute inset-0 flex items-center justify-center\">\n <LoadingIndicator color=\"current\" size=\"sm\" />\n </span>\n </>\n ) : (\n content\n )}\n </Comp>\n );\n },\n);\nButton.displayName = 'Button';\n\nexport { Button };\n"],"mappings":";;;;;;;;;AAoBA,IAAM,SAAS,QAAM,YAEjB,EACE,WACA,SACA,MACA,OACA,UAAU,OACV,UAAU,OACV,UACA,UACA,GAAG,SAEL,QACG;CACH,MAAM,EAAE,iBAAiB,SAAS;CAClC,MAAM,OAAO,UAAU,OAAO;CAC9B,MAAM,YAAY,WAAW,CAAC;CAC9B,MAAM,gBAAgB,YAAY,SAAS,YAAa,SAAS;CACjE,MAAM,UACJ,YAAY,aACV,qBAAA,YAAA,EAAA,UAAA,CACG,UACD,oBAAC,aAAD;EACE,WAAU;EACV,aAAa;CACd,CAAA,CACD,EAAA,CAAA,IAEF;CAGJ,OACE,oBAAC,MAAD;EACO;EACL,aAAW,aAAa,KAAA;EACxB,WAAW,GACT,aAAa,YACb,eAAe;GAAE;GAAS;GAAM,OAAO;GAAe;EAAU,CAAC,CACnE;EACA,UAAU,aAAa;EACvB,GAAI;EACJ,sBAAoB;YAEnB,YACC,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,QAAD;GAAM,WAAU;aACb;EACG,CAAA,GACN,oBAAC,QAAD;GAAM,WAAU;aACd,oBAAC,kBAAD;IAAkB,OAAM;IAAU,MAAK;GAAM,CAAA;EACzC,CAAA,CACN,EAAA,CAAA,IAEF;CAEE,CAAA;AAEV,CACF;AACA,OAAO,cAAc"}
1
+ {"version":3,"file":"button.js","names":[],"sources":["../../../src/components/ui/button.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { type VariantProps } from 'class-variance-authority';\nimport { ChevronDown } from 'lucide-react';\n\nimport { buttonVariants } from '@/components/ui/button-variants';\nimport { LoadingIndicator } from '@/components/ui/loading-indicator';\nimport { cn } from '@/lib/utils';\nimport { useShade } from '@/providers/shade-context';\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n /**\n * Disables the button and shows a spinner over its label. The label stays in\n * the layout, so the button keeps its width. Ignored with `asChild`.\n */\n loading?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n shape,\n asChild = false,\n loading = false,\n disabled,\n children,\n ...props\n },\n ref,\n ) => {\n const { controlShape } = useShade();\n const Comp = asChild ? Slot : 'button';\n const isLoading = loading && !asChild;\n const resolvedShape = variant === 'link' ? 'rounded' : (shape ?? controlShape);\n const content =\n variant === 'dropdown' ? (\n <>\n {children}\n <ChevronDown\n className=\"-mr-0.5! -ml-1! size-4 stroke-[2px]! opacity-50\"\n strokeWidth={2}\n />\n </>\n ) : (\n children\n );\n\n return (\n <Comp\n ref={ref}\n aria-busy={isLoading || undefined}\n className={cn(\n isLoading && 'relative',\n buttonVariants({ variant, size, shape: resolvedShape, className }),\n )}\n disabled={isLoading || disabled}\n {...props}\n data-control-shape={resolvedShape}\n data-variant={variant ?? 'default'}\n >\n {isLoading ? (\n <>\n <span className=\"inline-flex items-center justify-center gap-1.5 opacity-0\">\n {content}\n </span>\n <span className=\"absolute inset-0 flex items-center justify-center\">\n <LoadingIndicator color=\"current\" size=\"sm\" />\n </span>\n </>\n ) : (\n content\n )}\n </Comp>\n );\n },\n);\nButton.displayName = 'Button';\n\nexport { Button };\n"],"mappings":";;;;;;;;;AAoBA,IAAM,SAAS,QAAM,YAEjB,EACE,WACA,SACA,MACA,OACA,UAAU,OACV,UAAU,OACV,UACA,UACA,GAAG,SAEL,QACG;CACH,MAAM,EAAE,iBAAiB,SAAS;CAClC,MAAM,OAAO,UAAU,OAAO;CAC9B,MAAM,YAAY,WAAW,CAAC;CAC9B,MAAM,gBAAgB,YAAY,SAAS,YAAa,SAAS;CACjE,MAAM,UACJ,YAAY,aACV,qBAAA,YAAA,EAAA,UAAA,CACG,UACD,oBAAC,aAAD;EACE,WAAU;EACV,aAAa;CACd,CAAA,CACD,EAAA,CAAA,IAEF;CAGJ,OACE,oBAAC,MAAD;EACO;EACL,aAAW,aAAa,KAAA;EACxB,WAAW,GACT,aAAa,YACb,eAAe;GAAE;GAAS;GAAM,OAAO;GAAe;EAAU,CAAC,CACnE;EACA,UAAU,aAAa;EACvB,GAAI;EACJ,sBAAoB;EACpB,gBAAc,WAAW;YAExB,YACC,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,QAAD;GAAM,WAAU;aACb;EACG,CAAA,GACN,oBAAC,QAAD;GAAM,WAAU;aACd,oBAAC,kBAAD;IAAkB,OAAM;IAAU,MAAK;GAAM,CAAA;EACzC,CAAA,CACN,EAAA,CAAA,IAEF;CAEE,CAAA;AAEV,CACF;AACA,OAAO,cAAc"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryghost/shade",
3
- "version": "0.1.0-alpha.54",
3
+ "version": "0.1.0-alpha.55",
4
4
  "description": "Ghost design system for React apps",
5
5
  "license": "MIT",
6
6
  "author": "Ghost Foundation",
@@ -1 +1 @@
1
- {"version":3,"file":"setting-group.d.ts","sourceRoot":"","sources":["../../../src/components/patterns/setting-group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AAOpF,UAAU,iBACR,SAAQ,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC,OAAO,oBAAoB,CAAC;IACxF,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,QAAA,MAAM,YAAY,0FASjB,CAAC;AAGF,QAAA,MAAM,kBAAkB,0KAatB,CAAC;AAGH,QAAA,MAAM,mBAAmB,8KAKvB,CAAC;AAGH,QAA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B,CAAC;AAGF,UAAU,wBAAyB,SAAQ,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC;IAC9E,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;CACjB;AAED,QAAA,MAAM,mBAAmB,iGAsBxB,CAAC;AAGF,QAAA,MAAM,iBAAiB,8KAKrB,CAAC;AAGH,QAAA,MAAM,sBAAsB,sKAK1B,CAAC;AAGH,QAAA,MAAM,wBAAwB,0KAK5B,CAAC;AAGH,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,GACvB,CAAC;AACF,YAAY,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAG7D,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAKjE,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,YAAY,CAAC,OAAO,cAAc,CAAC;IAC1F,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,QAAA,MAAM,MAAM,uFA2DX,CAAC;AAGF,OAAO,EAAE,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAG7D,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAKjE,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,YAAY,CAAC,OAAO,cAAc,CAAC;IAC1F,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,QAAA,MAAM,MAAM,uFA4DX,CAAC;AAGF,OAAO,EAAE,MAAM,EAAE,CAAC"}