@propellerads/empty-state 6.0.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { forwardRef as n } from "react";
|
|
|
4
4
|
import { clsx as r } from "clsx";
|
|
5
5
|
import { cva as i } from "class-variance-authority";
|
|
6
6
|
import { jsx as a } from "react/jsx-runtime";
|
|
7
|
-
import './index.css'
|
|
7
|
+
import './index.css';// src/cn.ts
|
|
8
8
|
var o = (...e) => r(e), s = {
|
|
9
9
|
Plain: "plain",
|
|
10
10
|
Outline: "outline",
|
|
@@ -69,7 +69,6 @@ var g = n(({ className: e, ...t }, n) => /* @__PURE__ */ a("div", {
|
|
|
69
69
|
className: o("empty__content", e)
|
|
70
70
|
}));
|
|
71
71
|
g.displayName = "EmptyContent";
|
|
72
|
-
//#endregion
|
|
73
72
|
export { d as Empty, d as default, g as EmptyContent, h as EmptyDescription, f as EmptyHeader, p as EmptyMedia, c as EmptyMediaVariant, m as EmptyTitle, s as EmptyVariant, u as emptyMediaVariants, l as emptyVariants };
|
|
74
73
|
|
|
75
74
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/cn.ts","../src/types.ts","../src/variants.ts","../src/index.tsx"],"sourcesContent":["import {type ClassValue, clsx} from 'clsx';\n\n/**\n * Joins class names. There is no tailwind-merge here on purpose: the empty state\n * ships its own stylesheet instead of utility classes, so there is nothing to\n * deduplicate.\n */\nconst cn = (...inputs: ClassValue[]): string => clsx(inputs);\n\nexport {cn};\n","import type {useRender} from '@base-ui-components/react/use-render';\nimport type {ComponentPropsWithRef} from 'react';\n\n/** How the block is set off from the page. */\nexport const EmptyVariant = {\n /** Nothing around it: the block stands on whatever is behind it. */\n Plain: 'plain',\n /** A dashed contour: a place that is waiting to be filled — a list, a drop zone. */\n Outline: 'outline',\n /** A quiet pad: an empty panel inside a page that is otherwise full. */\n Muted: 'muted',\n} as const;\nexport type EmptyVariant = (typeof EmptyVariant)[keyof typeof EmptyVariant];\n\n/** How the picture above the title is drawn. */\nexport const EmptyMediaVariant = {\n /** As given: an icon at its own size. */\n Default: 'default',\n /** An icon on a 40px quiet square, sized to 24px. */\n Icon: 'icon',\n /** A 144px picture — an image or an SVG — fitted to the square. */\n Illustration: 'illustration',\n} as const;\nexport type EmptyMediaVariant = (typeof EmptyMediaVariant)[keyof typeof EmptyMediaVariant];\n\nexport type EmptyProps = ComponentPropsWithRef<'div'> & {\n /** @default 'plain' */\n variant?: EmptyVariant;\n};\n\nexport type EmptyHeaderProps = ComponentPropsWithRef<'div'>;\n\nexport type EmptyMediaProps = ComponentPropsWithRef<'div'> & {\n /** @default 'default' */\n variant?: EmptyMediaVariant;\n};\n\n/** `render` swaps the element: `render={<h2 />}` makes the title a heading of the page. */\nexport type EmptyTitleProps = useRender.ComponentProps<'div'>;\n\nexport type EmptyDescriptionProps = ComponentPropsWithRef<'div'>;\n\nexport type EmptyContentProps = ComponentPropsWithRef<'div'>;\n","import {cva} from 'class-variance-authority';\n\n/**\n * The class names the stylesheet defines. Exported so that a page can give its\n * own markup the look without rendering the component.\n */\nconst emptyVariants = cva('empty', {\n variants: {\n variant: {\n plain: '',\n outline: 'empty--outline',\n muted: 'empty--muted',\n },\n },\n defaultVariants: {\n variant: 'plain',\n },\n});\n\nconst emptyMediaVariants = cva('empty__media', {\n variants: {\n variant: {\n default: '',\n icon: 'empty__media--icon',\n illustration: 'empty__media--illustration',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n});\n\nexport {emptyMediaVariants, emptyVariants};\n","import {mergeProps} from '@base-ui-components/react/merge-props';\nimport {useRender} from '@base-ui-components/react/use-render';\nimport {forwardRef, type PropsWithoutRef} from 'react';\nimport './empty-state.css';\nimport {cn} from './cn';\nimport {\n type EmptyContentProps,\n type EmptyDescriptionProps,\n type EmptyHeaderProps,\n type EmptyMediaProps,\n EmptyMediaVariant,\n type EmptyProps,\n type EmptyTitleProps,\n EmptyVariant,\n} from './types';\nimport {emptyMediaVariants, emptyVariants} from './variants';\n\n/*\n * The parts follow shadcn's Empty: the block, the header holding the picture,\n * the title and the description, and the actions under it.\n */\n\n/** The block. Centres what is inside it. */\nconst Empty = forwardRef<HTMLDivElement, PropsWithoutRef<EmptyProps>>(\n ({variant = EmptyVariant.Plain, className, ...props}, ref) => (\n <div {...props} ref={ref} data-variant={variant} className={cn(emptyVariants({variant}), className)} />\n ),\n);\nEmpty.displayName = 'Empty';\n\n/** The picture, the title and the description, held together at a readable width. */\nconst EmptyHeader = forwardRef<HTMLDivElement, PropsWithoutRef<EmptyHeaderProps>>(({className, ...props}, ref) => (\n <div {...props} ref={ref} className={cn('empty__header', className)} />\n));\nEmptyHeader.displayName = 'EmptyHeader';\n\n/** The picture above the title. */\nconst EmptyMedia = forwardRef<HTMLDivElement, PropsWithoutRef<EmptyMediaProps>>(\n ({variant = EmptyMediaVariant.Default, className, ...props}, ref) => (\n <div {...props} ref={ref} data-variant={variant} className={cn(emptyMediaVariants({variant}), className)} />\n ),\n);\nEmptyMedia.displayName = 'EmptyMedia';\n\n/** The line that says what is missing. */\nconst EmptyTitle = forwardRef<HTMLDivElement, PropsWithoutRef<EmptyTitleProps>>(({className, render, ...props}, ref) =>\n useRender({\n defaultTagName: 'div',\n render,\n ref,\n props: mergeProps<'div'>({className: 'empty__title'}, {...props, className}),\n }),\n);\nEmptyTitle.displayName = 'EmptyTitle';\n\n/** What happens next, in a sentence. A link inside it is underlined. */\nconst EmptyDescription = forwardRef<HTMLDivElement, PropsWithoutRef<EmptyDescriptionProps>>(\n ({className, ...props}, ref) => <div {...props} ref={ref} className={cn('empty__description', className)} />,\n);\nEmptyDescription.displayName = 'EmptyDescription';\n\n/** What to do about it: a button, a pair of them, a field. */\nconst EmptyContent = forwardRef<HTMLDivElement, PropsWithoutRef<EmptyContentProps>>(({className, ...props}, ref) => (\n <div {...props} ref={ref} className={cn('empty__content', className)} />\n));\nEmptyContent.displayName = 'EmptyContent';\n\nexport default Empty;\n\nexport type {EmptyContentProps, EmptyDescriptionProps, EmptyHeaderProps, EmptyMediaProps, EmptyProps, EmptyTitleProps};\nexport {\n Empty,\n EmptyContent,\n EmptyDescription,\n EmptyHeader,\n EmptyMedia,\n EmptyMediaVariant,\n EmptyTitle,\n EmptyVariant,\n emptyMediaVariants,\n emptyVariants,\n};\n"],"mappings":";;;;;;;AAOA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["cn","inputs","clsx","EmptyVariant","EmptyMediaVariant","emptyVariants","cva","emptyMediaVariants","Empty","forwardRef","props","variant","className","EmptyHeader","EmptyMedia","EmptyTitle","useRender","mergeProps","EmptyDescription","EmptyContent"],"sources":["../src/cn.ts","../src/types.ts","../src/variants.ts","../src/index.tsx"],"sourcesContent":["import {type ClassValue, clsx} from 'clsx';\n\n/**\n * Joins class names. There is no tailwind-merge here on purpose: the empty state\n * ships its own stylesheet instead of utility classes, so there is nothing to\n * deduplicate.\n */\nconst cn = (...inputs: ClassValue[]): string => clsx(inputs);\n\nexport {cn};\n","import type {useRender} from '@base-ui-components/react/use-render';\nimport type {ComponentPropsWithRef} from 'react';\n\n/** How the block is set off from the page. */\nexport const EmptyVariant = {\n /** Nothing around it: the block stands on whatever is behind it. */\n Plain: 'plain',\n /** A dashed contour: a place that is waiting to be filled — a list, a drop zone. */\n Outline: 'outline',\n /** A quiet pad: an empty panel inside a page that is otherwise full. */\n Muted: 'muted',\n} as const;\nexport type EmptyVariant = (typeof EmptyVariant)[keyof typeof EmptyVariant];\n\n/** How the picture above the title is drawn. */\nexport const EmptyMediaVariant = {\n /** As given: an icon at its own size. */\n Default: 'default',\n /** An icon on a 40px quiet square, sized to 24px. */\n Icon: 'icon',\n /** A 144px picture — an image or an SVG — fitted to the square. */\n Illustration: 'illustration',\n} as const;\nexport type EmptyMediaVariant = (typeof EmptyMediaVariant)[keyof typeof EmptyMediaVariant];\n\nexport type EmptyProps = ComponentPropsWithRef<'div'> & {\n /** @default 'plain' */\n variant?: EmptyVariant;\n};\n\nexport type EmptyHeaderProps = ComponentPropsWithRef<'div'>;\n\nexport type EmptyMediaProps = ComponentPropsWithRef<'div'> & {\n /** @default 'default' */\n variant?: EmptyMediaVariant;\n};\n\n/** `render` swaps the element: `render={<h2 />}` makes the title a heading of the page. */\nexport type EmptyTitleProps = useRender.ComponentProps<'div'>;\n\nexport type EmptyDescriptionProps = ComponentPropsWithRef<'div'>;\n\nexport type EmptyContentProps = ComponentPropsWithRef<'div'>;\n","import {cva} from 'class-variance-authority';\n\n/**\n * The class names the stylesheet defines. Exported so that a page can give its\n * own markup the look without rendering the component.\n */\nconst emptyVariants = cva('empty', {\n variants: {\n variant: {\n plain: '',\n outline: 'empty--outline',\n muted: 'empty--muted',\n },\n },\n defaultVariants: {\n variant: 'plain',\n },\n});\n\nconst emptyMediaVariants = cva('empty__media', {\n variants: {\n variant: {\n default: '',\n icon: 'empty__media--icon',\n illustration: 'empty__media--illustration',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n});\n\nexport {emptyMediaVariants, emptyVariants};\n","import {mergeProps} from '@base-ui-components/react/merge-props';\nimport {useRender} from '@base-ui-components/react/use-render';\nimport {forwardRef, type PropsWithoutRef} from 'react';\nimport './empty-state.css';\nimport {cn} from './cn';\nimport {\n type EmptyContentProps,\n type EmptyDescriptionProps,\n type EmptyHeaderProps,\n type EmptyMediaProps,\n EmptyMediaVariant,\n type EmptyProps,\n type EmptyTitleProps,\n EmptyVariant,\n} from './types';\nimport {emptyMediaVariants, emptyVariants} from './variants';\n\n/*\n * The parts follow shadcn's Empty: the block, the header holding the picture,\n * the title and the description, and the actions under it.\n */\n\n/** The block. Centres what is inside it. */\nconst Empty = forwardRef<HTMLDivElement, PropsWithoutRef<EmptyProps>>(\n ({variant = EmptyVariant.Plain, className, ...props}, ref) => (\n <div {...props} ref={ref} data-variant={variant} className={cn(emptyVariants({variant}), className)} />\n ),\n);\nEmpty.displayName = 'Empty';\n\n/** The picture, the title and the description, held together at a readable width. */\nconst EmptyHeader = forwardRef<HTMLDivElement, PropsWithoutRef<EmptyHeaderProps>>(({className, ...props}, ref) => (\n <div {...props} ref={ref} className={cn('empty__header', className)} />\n));\nEmptyHeader.displayName = 'EmptyHeader';\n\n/** The picture above the title. */\nconst EmptyMedia = forwardRef<HTMLDivElement, PropsWithoutRef<EmptyMediaProps>>(\n ({variant = EmptyMediaVariant.Default, className, ...props}, ref) => (\n <div {...props} ref={ref} data-variant={variant} className={cn(emptyMediaVariants({variant}), className)} />\n ),\n);\nEmptyMedia.displayName = 'EmptyMedia';\n\n/** The line that says what is missing. */\nconst EmptyTitle = forwardRef<HTMLDivElement, PropsWithoutRef<EmptyTitleProps>>(({className, render, ...props}, ref) =>\n useRender({\n defaultTagName: 'div',\n render,\n ref,\n props: mergeProps<'div'>({className: 'empty__title'}, {...props, className}),\n }),\n);\nEmptyTitle.displayName = 'EmptyTitle';\n\n/** What happens next, in a sentence. A link inside it is underlined. */\nconst EmptyDescription = forwardRef<HTMLDivElement, PropsWithoutRef<EmptyDescriptionProps>>(\n ({className, ...props}, ref) => <div {...props} ref={ref} className={cn('empty__description', className)} />,\n);\nEmptyDescription.displayName = 'EmptyDescription';\n\n/** What to do about it: a button, a pair of them, a field. */\nconst EmptyContent = forwardRef<HTMLDivElement, PropsWithoutRef<EmptyContentProps>>(({className, ...props}, ref) => (\n <div {...props} ref={ref} className={cn('empty__content', className)} />\n));\nEmptyContent.displayName = 'EmptyContent';\n\nexport default Empty;\n\nexport type {EmptyContentProps, EmptyDescriptionProps, EmptyHeaderProps, EmptyMediaProps, EmptyProps, EmptyTitleProps};\nexport {\n Empty,\n EmptyContent,\n EmptyDescription,\n EmptyHeader,\n EmptyMedia,\n EmptyMediaVariant,\n EmptyTitle,\n EmptyVariant,\n emptyMediaVariants,\n emptyV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AC7E,CAAC,CACH;AACA,EAAW,cAAc;AAGzB,IAAMQ,IAAmBT,GACtB,EAAC,cAAW,GAAGC,KAAQ,MAAQ,kBAAC,OAAD;CAAK,GAAIA;CAAY;CAAK,WAAWV,EAAG,sBAAsBY,CAAS;AAAI,CAAA,CAC7G;AACA,EAAiB,cAAc;AAG/B,IAAMO,IAAeV,GAAgE,EAAC,cAAW,GAAGC,KAAQ,MAC1G,kBAAC,OAAD;CAAK,GAAIA;CAAY;CAAK,WAAWV,EAAG,kBAAkBY,CAAS;AAAI,CAAA,CACxE;AACD,EAAa,cAAc"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@propellerads/empty-state",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"style": "dist/index.css",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"url": "https://github.com/propellerads/ui-components/issues"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
|
-
"build": "tsc && vite build &&
|
|
27
|
+
"build": "tsc && vite build && rollup -c rollup.dts.config.mjs"
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/propellerads/ui-components#readme",
|
|
30
30
|
"private": false,
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"clsx": "^2.1.1"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@propellerads/tokens": ">=0.
|
|
37
|
+
"@propellerads/tokens": ">=0.5.0",
|
|
38
38
|
"react": "^18.0.0 || ^19.0.0",
|
|
39
39
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
40
40
|
},
|