@hanzo/ui 4.5.3 → 4.5.4
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/mcp/enhanced-server.js +1 -1
- package/dist/mcp/index.js +1 -1
- package/dist/registry/api.js +1 -2
- package/dist/registry/index.d.ts +348 -4
- package/package.json +1 -1
- package/tsconfig.json +9 -4
- package/dist/blocks/components/accordian-block.d.ts +0 -4
- package/dist/blocks/components/accordian-block.jsx +0 -25
- package/dist/blocks/components/block-component-props.d.ts +0 -7
- package/dist/blocks/components/block-component-props.js +0 -1
- package/dist/blocks/components/bullet-cards-block.d.ts +0 -4
- package/dist/blocks/components/bullet-cards-block.jsx +0 -25
- package/dist/blocks/components/card-block/index.d.ts +0 -6
- package/dist/blocks/components/card-block/index.jsx +0 -87
- package/dist/blocks/components/card-block/link-out-button.d.ts +0 -6
- package/dist/blocks/components/card-block/link-out-button.jsx +0 -4
- package/dist/blocks/components/card-block/util.d.ts +0 -4
- package/dist/blocks/components/card-block/util.js +0 -6
- package/dist/blocks/components/carte-blanche-block/index.d.ts +0 -4
- package/dist/blocks/components/carte-blanche-block/index.jsx +0 -82
- package/dist/blocks/components/carte-blanche-block/variant-content-left.d.ts +0 -10
- package/dist/blocks/components/carte-blanche-block/variant-content-left.jsx +0 -23
- package/dist/blocks/components/content.d.ts +0 -10
- package/dist/blocks/components/content.jsx +0 -47
- package/dist/blocks/components/cta-block.d.ts +0 -12
- package/dist/blocks/components/cta-block.jsx +0 -69
- package/dist/blocks/components/enh-heading-block.d.ts +0 -7
- package/dist/blocks/components/enh-heading-block.jsx +0 -142
- package/dist/blocks/components/grid-block/grid-block-mutator.d.ts +0 -5
- package/dist/blocks/components/grid-block/grid-block-mutator.js +0 -1
- package/dist/blocks/components/grid-block/index.d.ts +0 -9
- package/dist/blocks/components/grid-block/index.jsx +0 -56
- package/dist/blocks/components/grid-block/mutator-registry.d.ts +0 -3
- package/dist/blocks/components/grid-block/mutator-registry.js +0 -5
- package/dist/blocks/components/grid-block/table-borders.mutator.d.ts +0 -3
- package/dist/blocks/components/grid-block/table-borders.mutator.js +0 -36
- package/dist/blocks/components/group-block.d.ts +0 -7
- package/dist/blocks/components/group-block.jsx +0 -61
- package/dist/blocks/components/heading-block.d.ts +0 -4
- package/dist/blocks/components/heading-block.jsx +0 -99
- package/dist/blocks/components/image-block.d.ts +0 -7
- package/dist/blocks/components/image-block.jsx +0 -69
- package/dist/blocks/components/index.d.ts +0 -14
- package/dist/blocks/components/index.js +0 -13
- package/dist/blocks/components/screenful-block/content.d.ts +0 -8
- package/dist/blocks/components/screenful-block/content.jsx +0 -71
- package/dist/blocks/components/screenful-block/index.d.ts +0 -12
- package/dist/blocks/components/screenful-block/index.jsx +0 -57
- package/dist/blocks/components/screenful-block/poster-background.d.ts +0 -7
- package/dist/blocks/components/screenful-block/poster-background.jsx +0 -14
- package/dist/blocks/components/screenful-block/video-background.d.ts +0 -8
- package/dist/blocks/components/screenful-block/video-background.jsx +0 -20
- package/dist/blocks/components/space-block.d.ts +0 -4
- package/dist/blocks/components/space-block.jsx +0 -42
- package/dist/blocks/components/video-block.d.ts +0 -9
- package/dist/blocks/components/video-block.jsx +0 -83
- package/dist/blocks/def/accordian-block.d.ts +0 -10
- package/dist/blocks/def/accordian-block.js +0 -2
- package/dist/blocks/def/block.d.ts +0 -4
- package/dist/blocks/def/block.js +0 -1
- package/dist/blocks/def/bullet-cards-block.d.ts +0 -17
- package/dist/blocks/def/bullet-cards-block.js +0 -1
- package/dist/blocks/def/card-block.d.ts +0 -17
- package/dist/blocks/def/card-block.js +0 -2
- package/dist/blocks/def/carte-blanche-block.d.ts +0 -12
- package/dist/blocks/def/carte-blanche-block.js +0 -1
- package/dist/blocks/def/cta-block.d.ts +0 -8
- package/dist/blocks/def/cta-block.js +0 -1
- package/dist/blocks/def/element-block.d.ts +0 -7
- package/dist/blocks/def/element-block.js +0 -2
- package/dist/blocks/def/enh-heading-block.d.ts +0 -22
- package/dist/blocks/def/enh-heading-block.js +0 -1
- package/dist/blocks/def/grid-block.d.ts +0 -12
- package/dist/blocks/def/grid-block.js +0 -1
- package/dist/blocks/def/group-block.d.ts +0 -7
- package/dist/blocks/def/group-block.js +0 -1
- package/dist/blocks/def/heading-block.d.ts +0 -11
- package/dist/blocks/def/heading-block.js +0 -1
- package/dist/blocks/def/image-block.d.ts +0 -26
- package/dist/blocks/def/image-block.js +0 -1
- package/dist/blocks/def/index.d.ts +0 -17
- package/dist/blocks/def/index.js +0 -2
- package/dist/blocks/def/screenful-block.d.ts +0 -41
- package/dist/blocks/def/screenful-block.js +0 -1
- package/dist/blocks/def/space-block.d.ts +0 -47
- package/dist/blocks/def/space-block.js +0 -8
- package/dist/blocks/def/video-block.d.ts +0 -5
- package/dist/blocks/def/video-block.js +0 -1
- package/dist/blocks/index.d.ts +0 -2
- package/dist/blocks/index.js +0 -2
- package/dist/primitives/accordion.d.ts +0 -10
- package/dist/primitives/accordion.jsx +0 -21
- package/dist/primitives/action-button.d.ts +0 -9
- package/dist/primitives/action-button.jsx +0 -16
- package/dist/primitives/apply-typography.d.ts +0 -7
- package/dist/primitives/apply-typography.jsx +0 -38
- package/dist/primitives/aspect-ratio.d.ts +0 -3
- package/dist/primitives/aspect-ratio.jsx +0 -4
- package/dist/primitives/avatar.d.ts +0 -6
- package/dist/primitives/avatar.jsx +0 -11
- package/dist/primitives/badge.d.ts +0 -9
- package/dist/primitives/badge.jsx +0 -18
- package/dist/primitives/breadcrumb.d.ts +0 -19
- package/dist/primitives/breadcrumb.jsx +0 -27
- package/dist/primitives/breakpoint-indicator.d.ts +0 -3
- package/dist/primitives/breakpoint-indicator.jsx +0 -14
- package/dist/primitives/button.d.ts +0 -12
- package/dist/primitives/button.jsx +0 -55
- package/dist/primitives/calendar.d.ts +0 -8
- package/dist/primitives/calendar.jsx +0 -40
- package/dist/primitives/card.d.ts +0 -8
- package/dist/primitives/card.jsx +0 -18
- package/dist/primitives/carousel.d.ts +0 -18
- package/dist/primitives/carousel.jsx +0 -106
- package/dist/primitives/checkbox.d.ts +0 -4
- package/dist/primitives/checkbox.jsx +0 -15
- package/dist/primitives/combobox.d.ts +0 -41
- package/dist/primitives/combobox.jsx +0 -77
- package/dist/primitives/command.d.ts +0 -17
- package/dist/primitives/command.jsx +0 -38
- package/dist/primitives/context-menu.d.ts +0 -27
- package/dist/primitives/context-menu.jsx +0 -57
- package/dist/primitives/dialog-video-controller.d.ts +0 -3
- package/dist/primitives/dialog-video-controller.jsx +0 -24
- package/dist/primitives/dialog.d.ts +0 -28
- package/dist/primitives/dialog.jsx +0 -37
- package/dist/primitives/drawer.d.ts +0 -29
- package/dist/primitives/drawer.jsx +0 -34
- package/dist/primitives/form.d.ts +0 -12
- package/dist/primitives/form.jsx +0 -69
- package/dist/primitives/icons/github.d.ts +0 -4
- package/dist/primitives/icons/github.jsx +0 -6
- package/dist/primitives/icons/index.d.ts +0 -4
- package/dist/primitives/icons/index.js +0 -4
- package/dist/primitives/icons/youtube-logo.d.ts +0 -4
- package/dist/primitives/icons/youtube-logo.jsx +0 -39
- package/dist/primitives/index-common.d.ts +0 -47
- package/dist/primitives/index-common.js +0 -46
- package/dist/primitives/index-next.d.ts +0 -2
- package/dist/primitives/index-next.js +0 -2
- package/dist/primitives/input-otp.d.ts +0 -7
- package/dist/primitives/input-otp.jsx +0 -24
- package/dist/primitives/input.d.ts +0 -5
- package/dist/primitives/input.jsx +0 -11
- package/dist/primitives/label.d.ts +0 -5
- package/dist/primitives/label.jsx +0 -11
- package/dist/primitives/list-adaptor.d.ts +0 -9
- package/dist/primitives/list-adaptor.js +0 -1
- package/dist/primitives/list-box.d.ts +0 -10
- package/dist/primitives/list-box.jsx +0 -14
- package/dist/primitives/loading-spinner.d.ts +0 -5
- package/dist/primitives/loading-spinner.jsx +0 -8
- package/dist/primitives/navigation-menu.d.ts +0 -12
- package/dist/primitives/navigation-menu.jsx +0 -38
- package/dist/primitives/next/image.d.ts +0 -11
- package/dist/primitives/next/image.jsx +0 -42
- package/dist/primitives/next/index.d.ts +0 -7
- package/dist/primitives/next/index.js +0 -7
- package/dist/primitives/next/inline-icon.d.ts +0 -13
- package/dist/primitives/next/inline-icon.jsx +0 -15
- package/dist/primitives/next/link-element.d.ts +0 -23
- package/dist/primitives/next/link-element.jsx +0 -56
- package/dist/primitives/next/mdx-link.d.ts +0 -3
- package/dist/primitives/next/mdx-link.jsx +0 -12
- package/dist/primitives/next/media-stack.d.ts +0 -8
- package/dist/primitives/next/media-stack.jsx +0 -28
- package/dist/primitives/next/nav-items.d.ts +0 -10
- package/dist/primitives/next/nav-items.jsx +0 -24
- package/dist/primitives/next/youtube-embed.d.ts +0 -11
- package/dist/primitives/next/youtube-embed.jsx +0 -23
- package/dist/primitives/popover.d.ts +0 -9
- package/dist/primitives/popover.jsx +0 -18
- package/dist/primitives/progress.d.ts +0 -4
- package/dist/primitives/progress.jsx +0 -9
- package/dist/primitives/radio-group.d.ts +0 -7
- package/dist/primitives/radio-group.jsx +0 -18
- package/dist/primitives/scroll-area.d.ts +0 -5
- package/dist/primitives/scroll-area.jsx +0 -19
- package/dist/primitives/select.d.ts +0 -13
- package/dist/primitives/select.jsx +0 -62
- package/dist/primitives/separator.d.ts +0 -4
- package/dist/primitives/separator.jsx +0 -7
- package/dist/primitives/sheet.d.ts +0 -30
- package/dist/primitives/sheet.jsx +0 -56
- package/dist/primitives/skeleton.d.ts +0 -4
- package/dist/primitives/skeleton.jsx +0 -3
- package/dist/primitives/slider.d.ts +0 -9
- package/dist/primitives/slider.jsx +0 -30
- package/dist/primitives/sonner.d.ts +0 -5
- package/dist/primitives/sonner.jsx +0 -16
- package/dist/primitives/step-indicator.d.ts +0 -9
- package/dist/primitives/step-indicator.jsx +0 -23
- package/dist/primitives/switch.d.ts +0 -6
- package/dist/primitives/switch.jsx +0 -14
- package/dist/primitives/table.d.ts +0 -10
- package/dist/primitives/table.jsx +0 -21
- package/dist/primitives/tabs.d.ts +0 -7
- package/dist/primitives/tabs.jsx +0 -18
- package/dist/primitives/text-area.d.ts +0 -5
- package/dist/primitives/text-area.jsx +0 -9
- package/dist/primitives/toggle-group.d.ts +0 -14
- package/dist/primitives/toggle-group.jsx +0 -28
- package/dist/primitives/toggle.d.ts +0 -14
- package/dist/primitives/toggle.jsx +0 -52
- package/dist/primitives/tooltip.d.ts +0 -11
- package/dist/primitives/tooltip.jsx +0 -18
- package/dist/primitives/video-player.d.ts +0 -6
- package/dist/primitives/video-player.jsx +0 -8
- package/dist/style/theme-provider.d.ts +0 -4
- package/dist/style/theme-provider.jsx +0 -11
- package/dist/tailwind/fontFamily.tailwind.d.ts +0 -8
- package/dist/tailwind/fontFamily.tailwind.js +0 -7
- package/dist/tailwind/fontSize.tailwind.d.ts +0 -36
- package/dist/tailwind/fontSize.tailwind.js +0 -13
- package/dist/tailwind/index.d.ts +0 -3
- package/dist/tailwind/index.js +0 -2
- package/dist/tailwind/screens.tailwind.d.ts +0 -9
- package/dist/tailwind/screens.tailwind.js +0 -8
- package/dist/tailwind/tw-font-desc.d.ts +0 -6
- package/dist/tailwind/tw-font-desc.js +0 -6
- package/dist/types/animation-def.d.ts +0 -2
- package/dist/types/animation-def.js +0 -1
- package/dist/types/breakpoints.d.ts +0 -4
- package/dist/types/breakpoints.js +0 -4
- package/dist/types/bullet-item.d.ts +0 -6
- package/dist/types/bullet-item.js +0 -2
- package/dist/types/button-def.d.ts +0 -29
- package/dist/types/button-def.js +0 -2
- package/dist/types/dimensions.d.ts +0 -5
- package/dist/types/dimensions.js +0 -1
- package/dist/types/grid-def.d.ts +0 -36
- package/dist/types/grid-def.js +0 -33
- package/dist/types/image-def.d.ts +0 -27
- package/dist/types/image-def.js +0 -1
- package/dist/types/index.d.ts +0 -13
- package/dist/types/index.js +0 -2
- package/dist/types/link-def.d.ts +0 -44
- package/dist/types/link-def.js +0 -1
- package/dist/types/media-stack-def.d.ts +0 -25
- package/dist/types/media-stack-def.js +0 -1
- package/dist/types/t-shirt-size.d.ts +0 -2
- package/dist/types/t-shirt-size.js +0 -1
- package/dist/types/tshirt-dimensions.d.ts +0 -12
- package/dist/types/tshirt-dimensions.js +0 -1
- package/dist/types/video-def.d.ts +0 -9
- package/dist/types/video-def.js +0 -1
- package/dist/util/format-and-abbreviate-as-currency.d.ts +0 -11
- package/dist/util/format-and-abbreviate-as-currency.js +0 -91
- package/dist/util/format-to-max-char.d.ts +0 -5
- package/dist/util/format-to-max-char.js +0 -57
- package/dist/util/index-client.d.ts +0 -2
- package/dist/util/index-client.js +0 -3
- package/dist/util/index.d.ts +0 -17
- package/dist/util/index.js +0 -41
- package/dist/util/number-abbreviate.d.ts +0 -9
- package/dist/util/number-abbreviate.js +0 -30
- package/dist/util/specifier.d.ts +0 -7
- package/dist/util/specifier.js +0 -31
- package/dist/util/spread-to-transform.d.ts +0 -7
- package/dist/util/spread-to-transform.js +0 -18
- package/dist/util/step-animation.d.ts +0 -5
- package/dist/util/step-animation.js +0 -60
- package/dist/util/two-way-map.d.ts +0 -8
- package/dist/util/two-way-map.js +0 -16
- /package/{mcp → src/mcp}/README.md +0 -0
- /package/{mcp → src/mcp}/enhanced-server.ts +0 -0
- /package/{mcp → src/mcp}/index.ts +0 -0
- /package/{mcp → src/mcp}/package.json +0 -0
- /package/{registry → src/registry}/api.ts +0 -0
- /package/{registry → src/registry}/index.ts +0 -0
- /package/{registry → src/registry}/package.json +0 -0
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type Block from './block';
|
|
2
|
-
interface EnhHeadingBlock extends Block {
|
|
3
|
-
blockType: 'enh-heading';
|
|
4
|
-
specifiers?: string;
|
|
5
|
-
icon?: React.ReactNode;
|
|
6
|
-
iconSize?: number;
|
|
7
|
-
preheading?: {
|
|
8
|
-
text: string;
|
|
9
|
-
level?: number;
|
|
10
|
-
mb?: number;
|
|
11
|
-
};
|
|
12
|
-
heading: {
|
|
13
|
-
text: string;
|
|
14
|
-
level?: number;
|
|
15
|
-
mb?: number;
|
|
16
|
-
};
|
|
17
|
-
byline?: {
|
|
18
|
-
text: string;
|
|
19
|
-
level?: number;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export { type EnhHeadingBlock as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type Block from "./block";
|
|
2
|
-
import type GridDef from "../../types/grid-def";
|
|
3
|
-
interface GridBlock {
|
|
4
|
-
blockType: 'grid';
|
|
5
|
-
specifiers?: string;
|
|
6
|
-
grid: GridDef;
|
|
7
|
-
/**
|
|
8
|
-
* Ignored if children are supplied to the GridBlockComp
|
|
9
|
-
*/
|
|
10
|
-
cells?: Block[];
|
|
11
|
-
}
|
|
12
|
-
export { type GridBlock as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type Block from './block';
|
|
2
|
-
interface HeadingBlock extends Block {
|
|
3
|
-
blockType: 'heading';
|
|
4
|
-
heading: string;
|
|
5
|
-
byline?: string;
|
|
6
|
-
level?: number;
|
|
7
|
-
bylineLevel?: number;
|
|
8
|
-
spaceBetween?: number;
|
|
9
|
-
spaceAfter?: number;
|
|
10
|
-
}
|
|
11
|
-
export { type HeadingBlock as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { ImageDef } from '../../types';
|
|
2
|
-
import type Block from './block';
|
|
3
|
-
/**
|
|
4
|
-
* See {@link ImageDef}
|
|
5
|
-
* see https://nextjs.org/docs/app/api-reference/components/image
|
|
6
|
-
* as well as React.ImgHTMLAttributes.
|
|
7
|
-
*/
|
|
8
|
-
interface ImageBlock extends Block, ImageDef {
|
|
9
|
-
blockType: 'image';
|
|
10
|
-
/**
|
|
11
|
-
* Alignement: 'left' (default) / 'right' / 'center' (must be in flex-col parent)
|
|
12
|
-
* 'mobile-no-scale': By default, scales to 3/4 height (mobile and w < 'md')
|
|
13
|
-
* 'mobile-full-width': Overrides dim, etc. and renders full width (maintaining aspect ratio)
|
|
14
|
-
*/
|
|
15
|
-
specifiers?: string;
|
|
16
|
-
/** @deprecated Please use 'mobile-full-width' in specifiers */
|
|
17
|
-
fullWidthOnMobile?: boolean;
|
|
18
|
-
/** Next props */
|
|
19
|
-
props?: {
|
|
20
|
-
sizes?: string;
|
|
21
|
-
/** if true, any alignement specifiers are ignored */
|
|
22
|
-
fill?: boolean;
|
|
23
|
-
style?: any;
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
export { type ImageBlock as default, };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type AccordianBlock from './accordian-block';
|
|
2
|
-
import type Block from './block';
|
|
3
|
-
import type BulletCardsBlock from './bullet-cards-block';
|
|
4
|
-
import type CardBlock from './card-block';
|
|
5
|
-
import type CarteBlancheBlock from './carte-blanche-block';
|
|
6
|
-
import type CTABlock from './cta-block';
|
|
7
|
-
import type ElementBlock from './element-block';
|
|
8
|
-
import type GridBlock from './grid-block';
|
|
9
|
-
import type GroupBlock from './group-block';
|
|
10
|
-
import type EnhHeadingBlock from './enh-heading-block';
|
|
11
|
-
import type HeadingBlock from './heading-block';
|
|
12
|
-
import type ImageBlock from './image-block';
|
|
13
|
-
import type VideoBlock from './video-block';
|
|
14
|
-
import type SpaceBlock from './space-block';
|
|
15
|
-
import { SPACE_DEFAULTS } from './space-block';
|
|
16
|
-
import type ScreenfulBlock from './screenful-block';
|
|
17
|
-
export { type AccordianBlock, type Block, type BulletCardsBlock, type CardBlock, type CarteBlancheBlock, type CTABlock, type ElementBlock, type GridBlock, type GroupBlock, type HeadingBlock, type EnhHeadingBlock, type ImageBlock, type VideoBlock, type SpaceBlock, type ScreenfulBlock, SPACE_DEFAULTS };
|
package/dist/blocks/def/index.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import type Block from './block';
|
|
3
|
-
import type VideoBlock from './video-block';
|
|
4
|
-
/**
|
|
5
|
-
* A common screenful of content
|
|
6
|
-
* An optional banner image or video
|
|
7
|
-
* Content can be in columns
|
|
8
|
-
*/
|
|
9
|
-
interface ScreenfulBlock extends Block {
|
|
10
|
-
blockType: 'screenful';
|
|
11
|
-
/**
|
|
12
|
-
* Either an image URL, or a Video Block
|
|
13
|
-
*
|
|
14
|
-
* If VideoBlock, then it's poster will be rendered server-side
|
|
15
|
-
* and the <video> component will be lazy-loaded client-side.
|
|
16
|
-
*
|
|
17
|
-
* If in a scrolling situation, the video will autoplay when 75% in view
|
|
18
|
-
*/
|
|
19
|
-
banner?: string | VideoBlock;
|
|
20
|
-
/** Specifies rendering and layout hints and variants for block as a whole */
|
|
21
|
-
specifiers?: string;
|
|
22
|
-
/** Specifies rendering and layout hints and variants for corresponding column */
|
|
23
|
-
columnSpecifiers?: string[];
|
|
24
|
-
/**
|
|
25
|
-
* Mobile: The order in the single column mobile layout in which the columns appear.
|
|
26
|
-
* Overrides column order.
|
|
27
|
-
* eg, if you want the second tile of three at the top: [1, 0, 2]
|
|
28
|
-
*/
|
|
29
|
-
mobileOrder?: number[];
|
|
30
|
-
/**
|
|
31
|
-
* Content Blocks for 1-3 columns.
|
|
32
|
-
* (More than that is allowed, but impractical at many resolutions!)
|
|
33
|
-
* If > 1, it will be enclosed in a 'grid grid-cols-<x>' div.
|
|
34
|
-
*/
|
|
35
|
-
contentColumns: Block[][];
|
|
36
|
-
/** optional footer element below the grid */
|
|
37
|
-
footer?: ReactNode;
|
|
38
|
-
/** optional id for linking to this slide / screenful */
|
|
39
|
-
anchorId?: string;
|
|
40
|
-
}
|
|
41
|
-
export { type ScreenfulBlock as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { Breakpoint } from '../../types';
|
|
2
|
-
import type Block from './block';
|
|
3
|
-
type TWSpaceUnit = number;
|
|
4
|
-
type HeadingLevel = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
5
|
-
declare const SPACE_DEFAULTS: {
|
|
6
|
-
xs: number;
|
|
7
|
-
sm: number;
|
|
8
|
-
md: number;
|
|
9
|
-
lg: number;
|
|
10
|
-
xl: number;
|
|
11
|
-
};
|
|
12
|
-
interface SpaceBlock extends Block {
|
|
13
|
-
blockType: 'space';
|
|
14
|
-
/**
|
|
15
|
-
* TW units of vertical space, applied at Breakpoints
|
|
16
|
-
* or
|
|
17
|
-
* if just a number, that number at all Breakpoints
|
|
18
|
-
*
|
|
19
|
-
* default {
|
|
20
|
-
* xs: 2,
|
|
21
|
-
* sm: 4,
|
|
22
|
-
* md: 5,
|
|
23
|
-
* lg: 6,
|
|
24
|
-
* xl: 8
|
|
25
|
-
* }
|
|
26
|
-
*
|
|
27
|
-
* Any provided values will be merge w the defaults
|
|
28
|
-
* And applied as if they were tw classes in ascending
|
|
29
|
-
* order.
|
|
30
|
-
*
|
|
31
|
-
* impl: <div className='invisible w-[1px] xs:h-<xsval> sm:h-<smval> etc...' />
|
|
32
|
-
*/
|
|
33
|
-
sizes?: {
|
|
34
|
-
[key in (Breakpoint)]?: TWSpaceUnit;
|
|
35
|
-
} | TWSpaceUnit;
|
|
36
|
-
/**
|
|
37
|
-
* Heading levels. Gives the vertical space that the corresponding
|
|
38
|
-
* h tag would give.
|
|
39
|
-
* default: 3 (height of <h3>)
|
|
40
|
-
* 0 = 1rem (plus any gaps),
|
|
41
|
-
* For example, 1 = <h1 style={visibility: hidden}> </h1>
|
|
42
|
-
* As <ApplyTypography> would render it, plus any gap.
|
|
43
|
-
*/
|
|
44
|
-
level?: HeadingLevel;
|
|
45
|
-
test?: boolean;
|
|
46
|
-
}
|
|
47
|
-
export { type SpaceBlock as default, type TWSpaceUnit, type HeadingLevel, SPACE_DEFAULTS };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/blocks/index.d.ts
DELETED
package/dist/blocks/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
3
|
-
declare const Accordion: React.ForwardRefExoticComponent<(AccordionPrimitive.AccordionSingleProps | AccordionPrimitive.AccordionMultipleProps) & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
-
declare const AccordionItem: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
-
declare const AccordionTrigger: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
6
|
-
showChevron?: boolean;
|
|
7
|
-
headerClx?: string;
|
|
8
|
-
} & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
-
declare const AccordionContent: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
-
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
"use client";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
5
|
-
import { ChevronDown } from "lucide-react";
|
|
6
|
-
import { cn } from "../util";
|
|
7
|
-
const Accordion = AccordionPrimitive.Root;
|
|
8
|
-
const AccordionItem = React.forwardRef(({ className, ...props }, ref) => (<AccordionPrimitive.Item ref={ref} className={cn("border-b", className)} {...props}/>));
|
|
9
|
-
AccordionItem.displayName = "AccordionItem";
|
|
10
|
-
const AccordionTrigger = React.forwardRef(({ showChevron = true, headerClx, className, children, ...props }, ref) => (<AccordionPrimitive.Header className={cn('flex', headerClx)}>
|
|
11
|
-
<AccordionPrimitive.Trigger ref={ref} className={cn("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180", className)} {...props}>
|
|
12
|
-
{children}
|
|
13
|
-
{showChevron && <ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200"/>}
|
|
14
|
-
</AccordionPrimitive.Trigger>
|
|
15
|
-
</AccordionPrimitive.Header>));
|
|
16
|
-
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
17
|
-
const AccordionContent = React.forwardRef(({ className, children, ...props }, ref) => (<AccordionPrimitive.Content ref={ref} className={cn("overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down", className)} {...props}>
|
|
18
|
-
<div className="pb-4 pt-0">{children}</div>
|
|
19
|
-
</AccordionPrimitive.Content>));
|
|
20
|
-
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
|
21
|
-
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type VariantProps } from '../util';
|
|
3
|
-
import type { ButtonDef } from '../types';
|
|
4
|
-
import type { buttonVariants } from './button';
|
|
5
|
-
declare const ActionButton: React.FC<VariantProps<typeof buttonVariants> & {
|
|
6
|
-
def: ButtonDef;
|
|
7
|
-
className?: string;
|
|
8
|
-
}>;
|
|
9
|
-
export default ActionButton;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { cn } from '../util';
|
|
4
|
-
import DVC from './dialog-video-controller';
|
|
5
|
-
const ActionButton = ({ def, className = '', ...rest }) => {
|
|
6
|
-
if (def.action.type === 'modal') {
|
|
7
|
-
const m = def.action.def;
|
|
8
|
-
const Modal = m.Comp;
|
|
9
|
-
return (<DVC>
|
|
10
|
-
<Modal title={m.title} byline={m.byline} buttonText={def.text} buttonProps={{ ...def.props, ...rest, className: cn((def.props?.className ?? ''), className) }} action={m.action} actionEnclosure={m.actionEnclosure} {...m.props}/>
|
|
11
|
-
</DVC>);
|
|
12
|
-
}
|
|
13
|
-
// no other types supported yet
|
|
14
|
-
return <></>;
|
|
15
|
-
};
|
|
16
|
-
export default ActionButton;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
type TypographySize = 'responsive' | 'sm' | 'base' | 'lg' | 'xl';
|
|
3
|
-
declare const ApplyTypography: React.FC<React.ComponentProps<'div'> & {
|
|
4
|
-
asTag?: 'div' | 'section' | 'nav' | 'main' | 'article';
|
|
5
|
-
size?: TypographySize;
|
|
6
|
-
}>;
|
|
7
|
-
export { type TypographySize, ApplyTypography as default };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React, {} from 'react';
|
|
2
|
-
import { cn } from '../util';
|
|
3
|
-
const ApplyTypography = ({ children, className = '', asTag = 'div', size = 'responsive', ...rest }) => {
|
|
4
|
-
// responsive version by default
|
|
5
|
-
let typoClasses = 'typography gap-3 ' +
|
|
6
|
-
'xs:typography-sm ' +
|
|
7
|
-
'sm:typography sm:gap-4 ' +
|
|
8
|
-
'lg:typography-lg lg:gap-5 ' +
|
|
9
|
-
'xl:typography-xl xl:gap-6 ' +
|
|
10
|
-
'typography-headings:font-heading '; // only effects h1-h3 (in plugin)
|
|
11
|
-
switch (size) {
|
|
12
|
-
case 'sm':
|
|
13
|
-
{
|
|
14
|
-
typoClasses = 'typography typography-sm gap-3 typography-headings:font-heading typography-p:text-sm ';
|
|
15
|
-
}
|
|
16
|
-
break;
|
|
17
|
-
case 'base':
|
|
18
|
-
{
|
|
19
|
-
typoClasses = 'typography gap-4 typography-headings:font-heading ';
|
|
20
|
-
}
|
|
21
|
-
break;
|
|
22
|
-
case 'lg':
|
|
23
|
-
{
|
|
24
|
-
typoClasses = 'typography typography-lg gap-5 typography-headings:font-heading typography-p:text-lg ';
|
|
25
|
-
}
|
|
26
|
-
break;
|
|
27
|
-
case 'xl':
|
|
28
|
-
{
|
|
29
|
-
typoClasses = 'typography typography-xl gap-6 typography-headings:font-heading typography-p:text-lg ';
|
|
30
|
-
}
|
|
31
|
-
break;
|
|
32
|
-
}
|
|
33
|
-
const Tag = asTag;
|
|
34
|
-
return (<Tag {...rest} className={cn(typoClasses, className)}>
|
|
35
|
-
{children}
|
|
36
|
-
</Tag>);
|
|
37
|
-
};
|
|
38
|
-
export { ApplyTypography as default };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
3
|
-
declare const Avatar: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
4
|
-
declare const AvatarImage: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & React.RefAttributes<HTMLImageElement>, "ref"> & React.RefAttributes<HTMLImageElement>>;
|
|
5
|
-
declare const AvatarFallback: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
6
|
-
export { Avatar, AvatarImage, AvatarFallback };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
4
|
-
import { cn } from '../util';
|
|
5
|
-
const Avatar = React.forwardRef(({ className, ...props }, ref) => (<AvatarPrimitive.Root ref={ref} className={cn('relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full', className)} {...props}/>));
|
|
6
|
-
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
7
|
-
const AvatarImage = React.forwardRef(({ className, ...props }, ref) => (<AvatarPrimitive.Image ref={ref} className={cn('aspect-square h-full w-full', className)} {...props}/>));
|
|
8
|
-
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
9
|
-
const AvatarFallback = React.forwardRef(({ className, ...props }, ref) => (<AvatarPrimitive.Fallback ref={ref} className={cn('flex h-full w-full items-center justify-center rounded-full bg-muted', className)} {...props}/>));
|
|
10
|
-
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
11
|
-
export { Avatar, AvatarImage, AvatarFallback };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { type VariantProps } from "class-variance-authority";
|
|
3
|
-
declare const badgeVariants: (props?: ({
|
|
4
|
-
variant?: "default" | "secondary" | "outline" | "destructive" | null | undefined;
|
|
5
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
-
interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
7
|
-
}
|
|
8
|
-
declare const Badge: React.FC<BadgeProps>;
|
|
9
|
-
export { Badge as default, badgeVariants, type BadgeProps };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { cva } from "class-variance-authority";
|
|
3
|
-
import { cn } from "../util";
|
|
4
|
-
const badgeVariants = cva("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-ring ", {
|
|
5
|
-
variants: {
|
|
6
|
-
variant: {
|
|
7
|
-
default: "border-transparent bg-primary text-primary-fg shadow hover:bg-primary/80",
|
|
8
|
-
secondary: "border-transparent bg-secondary text-secondary-fg hover:bg-secondary/80",
|
|
9
|
-
destructive: "border-transparent bg-destructive text-destructive-fg shadow hover:bg-destructive/80",
|
|
10
|
-
outline: "text-foreground",
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
defaultVariants: {
|
|
14
|
-
variant: "default",
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
|
-
const Badge = ({ className, variant, ...props }) => (<div className={cn(badgeVariants({ variant }), className)} {...props}/>);
|
|
18
|
-
export { Badge as default, badgeVariants };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
declare const Breadcrumb: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
|
|
3
|
-
separator?: React.ReactNode;
|
|
4
|
-
} & React.RefAttributes<HTMLElement>>;
|
|
5
|
-
declare const BreadcrumbList: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "ref"> & React.RefAttributes<HTMLOListElement>>;
|
|
6
|
-
declare const BreadcrumbItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
7
|
-
declare const BreadcrumbLink: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & {
|
|
8
|
-
asChild?: boolean;
|
|
9
|
-
} & React.RefAttributes<HTMLAnchorElement>>;
|
|
10
|
-
declare const BreadcrumbPage: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
11
|
-
declare const BreadcrumbSeparator: {
|
|
12
|
-
({ children, className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
|
|
13
|
-
displayName: string;
|
|
14
|
-
};
|
|
15
|
-
declare const BreadcrumbEllipsis: {
|
|
16
|
-
({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
17
|
-
displayName: string;
|
|
18
|
-
};
|
|
19
|
-
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
3
|
-
import { ChevronRight, MoreHorizontal } from "lucide-react";
|
|
4
|
-
import { cn } from '../util';
|
|
5
|
-
const Breadcrumb = React.forwardRef(({ ...props }, ref) => <nav ref={ref} aria-label="breadcrumb" {...props}/>);
|
|
6
|
-
Breadcrumb.displayName = "Breadcrumb";
|
|
7
|
-
const BreadcrumbList = React.forwardRef(({ className, ...props }, ref) => (<ol ref={ref} className={cn("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-2 sm:gap-2.5", className)} {...props}/>));
|
|
8
|
-
BreadcrumbList.displayName = "BreadcrumbList";
|
|
9
|
-
const BreadcrumbItem = React.forwardRef(({ className, ...props }, ref) => (<li ref={ref} className={cn("inline-flex items-center gap-1.5", className)} {...props}/>));
|
|
10
|
-
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
11
|
-
const BreadcrumbLink = React.forwardRef(({ asChild, className, ...props }, ref) => {
|
|
12
|
-
const Comp = asChild ? Slot : "a";
|
|
13
|
-
return (<Comp ref={ref} className={cn("transition-colors hover:text-foreground", className)} {...props}/>);
|
|
14
|
-
});
|
|
15
|
-
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
16
|
-
const BreadcrumbPage = React.forwardRef(({ className, ...props }, ref) => (<span ref={ref} role="link" aria-disabled="true" aria-current="page" className={cn("font-normal text-foreground", className)} {...props}/>));
|
|
17
|
-
BreadcrumbPage.displayName = "BreadcrumbPage";
|
|
18
|
-
const BreadcrumbSeparator = ({ children, className, ...props }) => (<li role="presentation" aria-hidden="true" className={cn("[&>svg]:size-3.5", className)} {...props}>
|
|
19
|
-
{children ?? <ChevronRight />}
|
|
20
|
-
</li>);
|
|
21
|
-
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
|
|
22
|
-
const BreadcrumbEllipsis = ({ className, ...props }) => (<span role="presentation" aria-hidden="true" className={cn("flex h-9 w-9 items-center justify-center", className)} {...props}>
|
|
23
|
-
<MoreHorizontal className="h-4 w-4"/>
|
|
24
|
-
<span className="sr-only">More</span>
|
|
25
|
-
</span>);
|
|
26
|
-
BreadcrumbEllipsis.displayName = "BreadcrumbElipssis";
|
|
27
|
-
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
const BreakpointIndicator = () => {
|
|
3
|
-
if (process?.env?.NODE_ENV !== undefined && process.env.NODE_ENV === "production")
|
|
4
|
-
return null;
|
|
5
|
-
return (<div className="fixed bottom-1 left-1 z-floating flex h-6 w-6 items-center justify-center rounded-full bg-gray-800 p-3 font-mono text-xs text-primary">
|
|
6
|
-
<div className="block sm:hidden">xs</div>
|
|
7
|
-
<div className="hidden sm:block md:hidden">sm</div>
|
|
8
|
-
<div className="hidden md:block lg:hidden">md</div>
|
|
9
|
-
<div className="hidden lg:block xl:hidden">lg</div>
|
|
10
|
-
<div className="hidden xl:block 2xl:hidden">xl</div>
|
|
11
|
-
<div className="hidden 2xl:block">2xl</div>
|
|
12
|
-
</div>);
|
|
13
|
-
};
|
|
14
|
-
export default BreakpointIndicator;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { type VariantProps } from "class-variance-authority";
|
|
3
|
-
declare const buttonVariants: (props?: ({
|
|
4
|
-
variant?: "link" | "primary" | "secondary" | "outline" | "destructive" | "ghost" | "linkFG" | "linkMuted" | null | undefined;
|
|
5
|
-
size?: "link" | "default" | "xs" | "sm" | "square" | "lg" | "icon" | null | undefined;
|
|
6
|
-
rounded?: "none" | "md" | "sm" | "lg" | "full" | "xl" | null | undefined;
|
|
7
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
-
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
9
|
-
asChild?: boolean;
|
|
10
|
-
}
|
|
11
|
-
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
12
|
-
export { Button as default, type ButtonProps, buttonVariants, };
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
3
|
-
import { cva } from "class-variance-authority";
|
|
4
|
-
import { cn } from "../util";
|
|
5
|
-
// Define all variants
|
|
6
|
-
const variant = {
|
|
7
|
-
primary: "bg-primary text-primary-fg sm:hover:bg-primary-hover font-nav whitespace-nowrap not-typography",
|
|
8
|
-
secondary: "bg-secondary text-secondary-fg sm:hover:bg-secondary-hover font-nav whitespace-nowrap not-typography",
|
|
9
|
-
outline: "text-foreground bg-background border border-muted-4 sm:hover:bg-level-1 sm:hover:text-accent sm:hover:border-accent font-nav whitespace-nowrap not-typography",
|
|
10
|
-
destructive: "bg-destructive text-destructive-fg font-sans whitespace-nowrap sm:hover:bg-destructive-hover",
|
|
11
|
-
ghost: "text-foreground sm:hover:bg-level-1 sm:hover:text-accent whitespace-nowrap font-sans ",
|
|
12
|
-
link: "text-foreground sm:hover:text-muted-1 font-sans ",
|
|
13
|
-
linkFG: "text-foreground sm:hover:text-muted-1 font-sans ", // marker to style nav as regular link
|
|
14
|
-
linkMuted: "text-muted-1 sm:hover:text-foreground font-sans ",
|
|
15
|
-
};
|
|
16
|
-
// Define all sizes
|
|
17
|
-
const size = {
|
|
18
|
-
link: '',
|
|
19
|
-
xs: "h-8 px-2 text-xs",
|
|
20
|
-
sm: "h-9 px-3 text-xs",
|
|
21
|
-
square: 'h-9 py-2 px-2 text-sm aspect-square',
|
|
22
|
-
default: "h-9 py-2 px-4 text-sm md:text-base font-semibold min-w-0",
|
|
23
|
-
lg: "h-10 px-8 text-sm md:text-base font-semibold min-w-0 md:min-w-[260px] lg:min-w-[300px]",
|
|
24
|
-
icon: "h-10 w-10",
|
|
25
|
-
};
|
|
26
|
-
// Define rounded options
|
|
27
|
-
const rounded = {
|
|
28
|
-
full: 'rounded-full',
|
|
29
|
-
sm: 'rounded-sm',
|
|
30
|
-
md: 'rounded-md',
|
|
31
|
-
lg: 'rounded-lg',
|
|
32
|
-
xl: 'rounded-xl',
|
|
33
|
-
none: ''
|
|
34
|
-
};
|
|
35
|
-
// Updated buttonVariants with the latest Shadcn patterns
|
|
36
|
-
const buttonVariants = cva("inline-flex items-center justify-center font-medium ring-offset-background transition-colors " +
|
|
37
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 " +
|
|
38
|
-
"disabled:opacity-50 disabled:pointer-events-none", {
|
|
39
|
-
variants: {
|
|
40
|
-
variant,
|
|
41
|
-
size,
|
|
42
|
-
rounded
|
|
43
|
-
},
|
|
44
|
-
defaultVariants: {
|
|
45
|
-
variant: "primary",
|
|
46
|
-
size: "default",
|
|
47
|
-
rounded: 'md'
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
const Button = React.forwardRef(({ className, variant, size, rounded, asChild = false, ...props }, ref) => {
|
|
51
|
-
const Comp = asChild ? Slot : "button";
|
|
52
|
-
return (<Comp className={cn(buttonVariants({ variant, size, rounded }), className)} ref={ref} {...props}/>);
|
|
53
|
-
});
|
|
54
|
-
Button.displayName = "Button";
|
|
55
|
-
export { Button as default, buttonVariants, };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { DayPicker } from "react-day-picker";
|
|
3
|
-
export type CalendarProps = React.ComponentProps<typeof DayPicker>;
|
|
4
|
-
declare function Calendar({ className, classNames, showOutsideDays, ...props }: CalendarProps): React.JSX.Element;
|
|
5
|
-
declare namespace Calendar {
|
|
6
|
-
var displayName: string;
|
|
7
|
-
}
|
|
8
|
-
export default Calendar;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { ChevronLeftIcon, ChevronRightIcon } from "@radix-ui/react-icons";
|
|
4
|
-
import { DayPicker } from "react-day-picker";
|
|
5
|
-
import { cn } from "../util";
|
|
6
|
-
import { buttonVariants } from "./button";
|
|
7
|
-
function Calendar({ className, classNames, showOutsideDays = true, ...props }) {
|
|
8
|
-
return (<DayPicker showOutsideDays={showOutsideDays} className={cn("p-3", className)} classNames={{
|
|
9
|
-
months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
|
|
10
|
-
month: "space-y-4",
|
|
11
|
-
caption: "flex justify-center pt-1 relative items-center",
|
|
12
|
-
caption_label: "text-sm font-medium",
|
|
13
|
-
nav: "space-x-1 flex items-center",
|
|
14
|
-
nav_button: cn(buttonVariants({ variant: "outline" }), "h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),
|
|
15
|
-
nav_button_previous: "absolute left-1",
|
|
16
|
-
nav_button_next: "absolute right-1",
|
|
17
|
-
table: "w-full border-collapse space-y-1",
|
|
18
|
-
head_row: "flex",
|
|
19
|
-
head_cell: "text-muted-1 rounded-md w-8 font-normal text-[0.8rem]",
|
|
20
|
-
row: "flex w-full mt-2",
|
|
21
|
-
cell: cn("relative p-0 text-center text-sm focus-within:relative focus-within:z-above-content [&:has([aria-selected])]:bg-level-1 [&:has([aria-selected].day-outside)]:bg-level-1/50 [&:has([aria-selected].day-range-end)]:rounded-r-md", props.mode === "range"
|
|
22
|
-
? "[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md"
|
|
23
|
-
: "[&:has([aria-selected])]:rounded-md"),
|
|
24
|
-
day: cn(buttonVariants({ variant: "ghost" }), "h-8 w-8 p-0 font-normal aria-selected:opacity-100"),
|
|
25
|
-
day_range_start: "day-range-start",
|
|
26
|
-
day_range_end: "day-range-end",
|
|
27
|
-
day_selected: "bg-primary text-primary-fg hover:bg-primary hover:text-primary-fg focus:bg-primary focus:text-primary-fg",
|
|
28
|
-
day_today: "bg-accent text-primary-fg",
|
|
29
|
-
day_outside: "day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-1 aria-selected:opacity-30",
|
|
30
|
-
day_disabled: "text-muted-foreground opacity-50",
|
|
31
|
-
day_range_middle: "aria-selected:bg-accent aria-selected:text-primary-fg",
|
|
32
|
-
day_hidden: "invisible",
|
|
33
|
-
...classNames,
|
|
34
|
-
}} components={{
|
|
35
|
-
IconLeft: ({ ...props }) => <ChevronLeftIcon className="h-4 w-4"/>,
|
|
36
|
-
IconRight: ({ ...props }) => <ChevronRightIcon className="h-4 w-4"/>,
|
|
37
|
-
}} {...props}/>);
|
|
38
|
-
}
|
|
39
|
-
Calendar.displayName = "Calendar";
|
|
40
|
-
export default Calendar;
|