@kushagradhawan/kookie-ui 0.1.3 → 0.1.5
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/components.css +35 -0
- package/dist/cjs/components/_internal/base-button.d.ts +4 -2
- package/dist/cjs/components/_internal/base-button.d.ts.map +1 -1
- package/dist/cjs/components/_internal/base-button.js +1 -1
- package/dist/cjs/components/_internal/base-button.js.map +3 -3
- package/dist/cjs/components/_internal/base-button.props.d.ts +5 -0
- package/dist/cjs/components/_internal/base-button.props.d.ts.map +1 -1
- package/dist/cjs/components/_internal/base-button.props.js +1 -1
- package/dist/cjs/components/_internal/base-button.props.js.map +2 -2
- package/dist/cjs/components/button.d.ts +12 -3
- package/dist/cjs/components/button.d.ts.map +1 -1
- package/dist/cjs/components/button.js +1 -1
- package/dist/cjs/components/button.js.map +2 -2
- package/dist/cjs/components/icon-button.d.ts +12 -3
- package/dist/cjs/components/icon-button.d.ts.map +1 -1
- package/dist/cjs/components/icon-button.js +1 -1
- package/dist/cjs/components/icon-button.js.map +2 -2
- package/dist/cjs/components/index.d.ts +2 -0
- package/dist/cjs/components/index.d.ts.map +1 -1
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/index.js.map +3 -3
- package/dist/cjs/components/toggle-button.d.ts +11 -0
- package/dist/cjs/components/toggle-button.d.ts.map +1 -0
- package/dist/cjs/components/toggle-button.js +2 -0
- package/dist/cjs/components/toggle-button.js.map +7 -0
- package/dist/cjs/components/toggle-icon-button.d.ts +11 -0
- package/dist/cjs/components/toggle-icon-button.d.ts.map +1 -0
- package/dist/cjs/components/toggle-icon-button.js +2 -0
- package/dist/cjs/components/toggle-icon-button.js.map +7 -0
- package/dist/esm/components/_internal/base-button.d.ts +4 -2
- package/dist/esm/components/_internal/base-button.d.ts.map +1 -1
- package/dist/esm/components/_internal/base-button.js +1 -1
- package/dist/esm/components/_internal/base-button.js.map +3 -3
- package/dist/esm/components/_internal/base-button.props.d.ts +5 -0
- package/dist/esm/components/_internal/base-button.props.d.ts.map +1 -1
- package/dist/esm/components/_internal/base-button.props.js +1 -1
- package/dist/esm/components/_internal/base-button.props.js.map +2 -2
- package/dist/esm/components/button.d.ts +12 -3
- package/dist/esm/components/button.d.ts.map +1 -1
- package/dist/esm/components/button.js +1 -1
- package/dist/esm/components/button.js.map +2 -2
- package/dist/esm/components/icon-button.d.ts +12 -3
- package/dist/esm/components/icon-button.d.ts.map +1 -1
- package/dist/esm/components/icon-button.js +1 -1
- package/dist/esm/components/icon-button.js.map +2 -2
- package/dist/esm/components/index.d.ts +2 -0
- package/dist/esm/components/index.d.ts.map +1 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +3 -3
- package/dist/esm/components/toggle-button.d.ts +11 -0
- package/dist/esm/components/toggle-button.d.ts.map +1 -0
- package/dist/esm/components/toggle-button.js +2 -0
- package/dist/esm/components/toggle-button.js.map +7 -0
- package/dist/esm/components/toggle-icon-button.d.ts +11 -0
- package/dist/esm/components/toggle-icon-button.d.ts.map +1 -0
- package/dist/esm/components/toggle-icon-button.js +2 -0
- package/dist/esm/components/toggle-icon-button.js.map +7 -0
- package/package.json +1 -1
- package/src/components/_internal/base-button.css +60 -0
- package/src/components/_internal/base-button.props.ts +2 -0
- package/src/components/_internal/base-button.tsx +20 -6
- package/src/components/button.tsx +18 -5
- package/src/components/icon-button.tsx +21 -5
- package/src/components/index.tsx +2 -0
- package/src/components/toggle-button.tsx +30 -0
- package/src/components/toggle-icon-button.tsx +30 -0
- package/styles.css +35 -0
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { BaseButton } from './_internal/base-button.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import type { BaseButtonProps } from './_internal/base-button.js';
|
|
4
|
+
type ButtonElement = React.ElementRef<typeof BaseButton>;
|
|
5
|
+
type ButtonOwnProps = Omit<BaseButtonProps, 'as'>;
|
|
6
|
+
type ButtonProps<C extends React.ElementType = 'button'> = ButtonOwnProps & {
|
|
7
|
+
as?: C;
|
|
8
|
+
} & Omit<React.ComponentPropsWithoutRef<C>, keyof ButtonOwnProps>;
|
|
9
|
+
type ButtonComponent = <C extends React.ElementType = 'button'>(props: ButtonProps<C> & {
|
|
10
|
+
ref?: React.ForwardedRef<ButtonElement>;
|
|
11
|
+
}) => React.ReactElement | null;
|
|
12
|
+
declare const Button: ButtonComponent & {
|
|
13
|
+
displayName?: string;
|
|
14
|
+
};
|
|
6
15
|
export { Button };
|
|
7
16
|
export type { ButtonProps };
|
|
8
17
|
//# sourceMappingURL=button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,KAAK,aAAa,GAAG,KAAK,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAGzD,KAAK,cAAc,GAAG,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;AAElD,KAAK,WAAW,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,IAAI,cAAc,GAAG;IAC1E,EAAE,CAAC,EAAE,CAAC,CAAC;CACR,GAAG,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,MAAM,cAAc,CAAC,CAAC;AAElE,KAAK,eAAe,GAAG,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,EAC5D,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,aAAa,CAAC,CAAA;CAAE,KAChE,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;AAE/B,QAAA,MAAM,MAAM,EAIP,eAAe,GAAG;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAIhD,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,YAAY,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as t from"react";import
|
|
1
|
+
import*as t from"react";import r from"classnames";import{BaseButton as s}from"./_internal/base-button.js";const e=t.forwardRef(({className:o,...n},p)=>t.createElement(s,{...n,ref:p,className:r("rt-Button",o)}));e.displayName="Button";export{e as Button};
|
|
2
2
|
//# sourceMappingURL=button.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/button.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { BaseButton } from './_internal/base-button.js';\n\ntype ButtonElement = React.ElementRef<typeof BaseButton>;\
|
|
5
|
-
"mappings": "AAAA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aAEvB,OAAS,cAAAC,MAAkB,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { BaseButton } from './_internal/base-button.js';\nimport type { BaseButtonProps } from './_internal/base-button.js';\n\ntype ButtonElement = React.ElementRef<typeof BaseButton>;\n\n// Polymorphic Button props\ntype ButtonOwnProps = Omit<BaseButtonProps, 'as'>;\n\ntype ButtonProps<C extends React.ElementType = 'button'> = ButtonOwnProps & {\n as?: C;\n} & Omit<React.ComponentPropsWithoutRef<C>, keyof ButtonOwnProps>;\n\ntype ButtonComponent = <C extends React.ElementType = 'button'>(\n props: ButtonProps<C> & { ref?: React.ForwardedRef<ButtonElement> },\n) => React.ReactElement | null;\n\nconst Button = React.forwardRef(\n ({ className, ...props }: ButtonProps, forwardedRef: React.ForwardedRef<ButtonElement>) => (\n <BaseButton {...props} ref={forwardedRef} className={classNames('rt-Button', className)} />\n ),\n) as ButtonComponent & { displayName?: string };\n\nButton.displayName = 'Button';\n\nexport { Button };\nexport type { ButtonProps };\n"],
|
|
5
|
+
"mappings": "AAAA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aAEvB,OAAS,cAAAC,MAAkB,6BAgB3B,MAAMC,EAASH,EAAM,WACnB,CAAC,CAAE,UAAAI,EAAW,GAAGC,CAAM,EAAgBC,IACrCN,EAAA,cAACE,EAAA,CAAY,GAAGG,EAAO,IAAKC,EAAc,UAAWL,EAAW,YAAaG,CAAS,EAAG,CAE7F,EAEAD,EAAO,YAAc",
|
|
6
6
|
"names": ["React", "classNames", "BaseButton", "Button", "className", "props", "forwardedRef"]
|
|
7
7
|
}
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { BaseButton } from './_internal/base-button.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import type { BaseButtonProps } from './_internal/base-button.js';
|
|
4
|
+
type IconButtonElement = React.ElementRef<typeof BaseButton>;
|
|
5
|
+
type IconButtonOwnProps = Omit<BaseButtonProps, 'as'>;
|
|
6
|
+
type IconButtonProps<C extends React.ElementType = 'button'> = IconButtonOwnProps & {
|
|
7
|
+
as?: C;
|
|
8
|
+
} & Omit<React.ComponentPropsWithoutRef<C>, keyof IconButtonOwnProps>;
|
|
9
|
+
type IconButtonComponent = <C extends React.ElementType = 'button'>(props: IconButtonProps<C> & {
|
|
10
|
+
ref?: React.ForwardedRef<IconButtonElement>;
|
|
11
|
+
}) => React.ReactElement | null;
|
|
12
|
+
declare const IconButton: IconButtonComponent & {
|
|
13
|
+
displayName?: string;
|
|
14
|
+
};
|
|
6
15
|
export { IconButton };
|
|
7
16
|
export type { IconButtonProps };
|
|
8
17
|
//# sourceMappingURL=icon-button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../../src/components/icon-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../../src/components/icon-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,KAAK,iBAAiB,GAAG,KAAK,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAG7D,KAAK,kBAAkB,GAAG,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;AAEtD,KAAK,eAAe,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,IAAI,kBAAkB,GAAG;IAClF,EAAE,CAAC,EAAE,CAAC,CAAC;CACR,GAAG,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,MAAM,kBAAkB,CAAC,CAAC;AAEtE,KAAK,mBAAmB,GAAG,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,EAChE,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAA;CAAE,KACxE,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;AAE/B,QAAA,MAAM,UAAU,EAOX,mBAAmB,GAAG;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAIpD,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as t from"react";import
|
|
1
|
+
import*as t from"react";import r from"classnames";import{BaseButton as s}from"./_internal/base-button.js";const o=t.forwardRef(({className:e,...n},p)=>t.createElement(s,{...n,ref:p,className:r("rt-IconButton",e)}));o.displayName="IconButton";export{o as IconButton};
|
|
2
2
|
//# sourceMappingURL=icon-button.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/icon-button.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { BaseButton } from './_internal/base-button.js';\n\ntype IconButtonElement = React.ElementRef<typeof BaseButton>;\
|
|
5
|
-
"mappings": "AAAA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aAEvB,OAAS,cAAAC,MAAkB,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { BaseButton } from './_internal/base-button.js';\nimport type { BaseButtonProps } from './_internal/base-button.js';\n\ntype IconButtonElement = React.ElementRef<typeof BaseButton>;\n\n// Polymorphic IconButton props\ntype IconButtonOwnProps = Omit<BaseButtonProps, 'as'>;\n\ntype IconButtonProps<C extends React.ElementType = 'button'> = IconButtonOwnProps & {\n as?: C;\n} & Omit<React.ComponentPropsWithoutRef<C>, keyof IconButtonOwnProps>;\n\ntype IconButtonComponent = <C extends React.ElementType = 'button'>(\n props: IconButtonProps<C> & { ref?: React.ForwardedRef<IconButtonElement> },\n) => React.ReactElement | null;\n\nconst IconButton = React.forwardRef(\n (\n { className, ...props }: IconButtonProps,\n forwardedRef: React.ForwardedRef<IconButtonElement>,\n ) => (\n <BaseButton {...props} ref={forwardedRef} className={classNames('rt-IconButton', className)} />\n ),\n) as IconButtonComponent & { displayName?: string };\n\nIconButton.displayName = 'IconButton';\n\nexport { IconButton };\nexport type { IconButtonProps };\n"],
|
|
5
|
+
"mappings": "AAAA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aAEvB,OAAS,cAAAC,MAAkB,6BAgB3B,MAAMC,EAAaH,EAAM,WACvB,CACE,CAAE,UAAAI,EAAW,GAAGC,CAAM,EACtBC,IAEAN,EAAA,cAACE,EAAA,CAAY,GAAGG,EAAO,IAAKC,EAAc,UAAWL,EAAW,gBAAiBG,CAAS,EAAG,CAEjG,EAEAD,EAAW,YAAc",
|
|
6
6
|
"names": ["React", "classNames", "BaseButton", "IconButton", "className", "props", "forwardedRef"]
|
|
7
7
|
}
|
|
@@ -54,6 +54,8 @@ export * as TextField from './text-field.js';
|
|
|
54
54
|
export { Text, type TextProps } from './text.js';
|
|
55
55
|
export { ThemePanel, type ThemePanelProps } from './theme-panel.js';
|
|
56
56
|
export { Theme, ThemeContext, type ThemeProps, useThemeContext } from './theme.js';
|
|
57
|
+
export { ToggleButton, type ToggleButtonProps } from './toggle-button.js';
|
|
58
|
+
export { ToggleIconButton, type ToggleIconButtonProps } from './toggle-icon-button.js';
|
|
57
59
|
export { Tooltip, type TooltipProps } from './tooltip.js';
|
|
58
60
|
export { VisuallyHidden, type VisuallyHiddenProps } from './visually-hidden.js';
|
|
59
61
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,KAAK,WAAW,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM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,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,UAAU,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACvF,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{AccessibleIcon as e}from"./accessible-icon.js";import*as t from"./alert-dialog.js";import{AspectRatio as s}from"./aspect-ratio.js";import{Avatar as m}from"./avatar.js";import{Badge as f}from"./badge.js";import{Blockquote as P}from"./blockquote.js";import{Box as
|
|
1
|
+
import{AccessibleIcon as e}from"./accessible-icon.js";import*as t from"./alert-dialog.js";import{AspectRatio as s}from"./aspect-ratio.js";import{Avatar as m}from"./avatar.js";import{Badge as f}from"./badge.js";import{Blockquote as P}from"./blockquote.js";import{Box as i}from"./box.js";import{Button as c}from"./button.js";import*as d from"./callout.js";import{Card as C}from"./card.js";import*as g from"./checkbox-cards.js";import*as u from"./checkbox-group.js";import{Checkbox as h}from"./checkbox.js";import{Code as B}from"./code.js";import{Container as b}from"./container.js";import*as A from"./context-menu.js";import*as R from"./data-list.js";import*as v from"./dialog.js";import*as D from"./dropdown-menu.js";import{Em as w}from"./em.js";import{Flex as F}from"./flex.js";import{Grid as q}from"./grid.js";import{Heading as K}from"./heading.js";import*as M from"./hover-card.js";import{IconButton as V}from"./icon-button.js";import{ChevronDownIcon as N,ThickCheckIcon as j,ThickChevronRightIcon as J,ThickDividerHorizontalIcon as O}from"./icons.js";import{Inset as W}from"./inset.js";import{Kbd as Y}from"./kbd.js";import{Link as _}from"./link.js";import*as $ from"./popover.js";import{Portal as ro}from"./portal.js";import{Progress as to}from"./progress.js";import{Quote as so}from"./quote.js";import*as xo from"./radio-cards.js";import*as mo from"./radio-group.js";import{Radio as fo}from"./radio.js";import{Reset as Po}from"./reset.js";import{ScrollArea as io}from"./scroll-area.js";import*as lo from"./segmented-control.js";import{Section as To}from"./section.js";import*as Co from"./select.js";import{Separator as uo}from"./separator.js";import{Skeleton as ho}from"./skeleton.js";import{Slider as Bo}from"./slider.js";import{Slot as bo,Slottable as Ao}from"./slot.js";import{Spinner as vo}from"./spinner.js";import{Strong as Ho}from"./strong.js";import{Switch as Go}from"./switch.js";import*as Fo from"./tab-nav.js";import*as Lo from"./table.js";import*as qo from"./tabs.js";import{TextArea as Ko}from"./text-area.js";import*as Mo from"./text-field.js";import{Text as Vo}from"./text.js";import{ThemePanel as No}from"./theme-panel.js";import{Theme as Jo,ThemeContext as Oo,useThemeContext as Uo}from"./theme.js";import{ToggleButton as Xo}from"./toggle-button.js";import{ToggleIconButton as Zo}from"./toggle-icon-button.js";import{Tooltip as $o}from"./tooltip.js";import{VisuallyHidden as rr}from"./visually-hidden.js";export{e as AccessibleIcon,t as AlertDialog,s as AspectRatio,m as Avatar,f as Badge,P as Blockquote,i as Box,c as Button,d as Callout,C as Card,h as Checkbox,g as CheckboxCards,u as CheckboxGroup,N as ChevronDownIcon,B as Code,b as Container,A as ContextMenu,R as DataList,v as Dialog,D as DropdownMenu,w as Em,F as Flex,q as Grid,K as Heading,M as HoverCard,V as IconButton,W as Inset,Y as Kbd,_ as Link,$ as Popover,ro as Portal,to as Progress,so as Quote,fo as Radio,xo as RadioCards,mo as RadioGroup,Po as Reset,io as ScrollArea,To as Section,lo as SegmentedControl,Co as Select,uo as Separator,ho as Skeleton,Bo as Slider,bo as Slot,Ao as Slottable,vo as Spinner,Ho as Strong,Go as Switch,Fo as TabNav,Lo as Table,qo as Tabs,Vo as Text,Ko as TextArea,Mo as TextField,Jo as Theme,Oo as ThemeContext,No as ThemePanel,j as ThickCheckIcon,J as ThickChevronRightIcon,O as ThickDividerHorizontalIcon,Xo as ToggleButton,Zo as ToggleIconButton,$o as Tooltip,rr as VisuallyHidden,Uo as useThemeContext};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/index.tsx"],
|
|
4
|
-
"sourcesContent": ["export { AccessibleIcon, type AccessibleIconProps } from './accessible-icon.js';\nexport * as AlertDialog from './alert-dialog.js';\nexport { AspectRatio, type AspectRatioProps } from './aspect-ratio.js';\nexport { Avatar, type AvatarProps } from './avatar.js';\nexport { Badge, type BadgeProps } from './badge.js';\nexport { Blockquote, type BlockquoteProps } from './blockquote.js';\nexport { Box, type BoxProps } from './box.js';\nexport { Button, type ButtonProps } from './button.js';\nexport * as Callout from './callout.js';\nexport { Card, type CardProps } from './card.js';\nexport * as CheckboxCards from './checkbox-cards.js';\nexport * as CheckboxGroup from './checkbox-group.js';\nexport { Checkbox, type CheckboxProps } from './checkbox.js';\nexport { Code, type CodeProps } from './code.js';\nexport { Container, type ContainerProps } from './container.js';\nexport * as ContextMenu from './context-menu.js';\nexport * as DataList from './data-list.js';\nexport * as Dialog from './dialog.js';\nexport * as DropdownMenu from './dropdown-menu.js';\nexport { Em, type EmProps } from './em.js';\nexport { Flex, type FlexProps } from './flex.js';\nexport { Grid, type GridProps } from './grid.js';\nexport { Heading, type HeadingProps } from './heading.js';\nexport * as HoverCard from './hover-card.js';\nexport { IconButton, type IconButtonProps } from './icon-button.js';\nexport {\n type IconProps,\n ChevronDownIcon,\n ThickCheckIcon,\n ThickChevronRightIcon,\n ThickDividerHorizontalIcon,\n} from './icons.js';\nexport { Inset, type InsetProps } from './inset.js';\nexport { Kbd, type KbdProps } from './kbd.js';\nexport { Link, type LinkProps } from './link.js';\nexport * as Popover from './popover.js';\nexport { Portal, type PortalProps } from './portal.js';\nexport { Progress, type ProgressProps } from './progress.js';\nexport { Quote, type QuoteProps } from './quote.js';\nexport * as RadioCards from './radio-cards.js';\nexport * as RadioGroup from './radio-group.js';\nexport { Radio, type RadioProps } from './radio.js';\nexport { Reset, type ResetProps } from './reset.js';\nexport { ScrollArea, type ScrollAreaProps } from './scroll-area.js';\nexport * as SegmentedControl from './segmented-control.js';\nexport { Section, type SectionProps } from './section.js';\nexport * as Select from './select.js';\nexport { Separator, type SeparatorProps } from './separator.js';\nexport { Skeleton, type SkeletonProps } from './skeleton.js';\nexport { Slider, type SliderProps } from './slider.js';\nexport { Slot, Slottable } from './slot.js';\nexport { Spinner, type SpinnerProps } from './spinner.js';\nexport { Strong, type StrongProps } from './strong.js';\nexport { Switch, type SwitchProps } from './switch.js';\nexport * as TabNav from './tab-nav.js';\nexport * as Table from './table.js';\nexport * as Tabs from './tabs.js';\nexport { TextArea, type TextAreaProps } from './text-area.js';\nexport * as TextField from './text-field.js';\nexport { Text, type TextProps } from './text.js';\nexport { ThemePanel, type ThemePanelProps } from './theme-panel.js';\nexport { Theme, ThemeContext, type ThemeProps, useThemeContext } from './theme.js';\nexport { Tooltip, type TooltipProps } from './tooltip.js';\nexport { VisuallyHidden, type VisuallyHiddenProps } from './visually-hidden.js';\n"],
|
|
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kC,eAC3C,OAAS,UAAAC,OAAgC,cACzC,OAAS,UAAAC,OAAgC,cACzC,UAAYC,OAAY,eACxB,UAAYC,OAAW,aACvB,UAAYC,OAAU,YACtB,OAAS,YAAAC,OAAoC,iBAC7C,UAAYC,OAAe,kBAC3B,OAAS,QAAAC,OAA4B,YACrC,OAAS,cAAAC,OAAwC,mBACjD,OAAS,SAAAC,GAAO,gBAAAC,GAA+B,mBAAAC,OAAuB,aACtE,OAAS,WAAAC,OAAkC,eAC3C,OAAS,kBAAAC,OAAgD",
|
|
6
|
-
"names": ["AccessibleIcon", "AlertDialog", "AspectRatio", "Avatar", "Badge", "Blockquote", "Box", "Button", "Callout", "Card", "CheckboxCards", "CheckboxGroup", "Checkbox", "Code", "Container", "ContextMenu", "DataList", "Dialog", "DropdownMenu", "Em", "Flex", "Grid", "Heading", "HoverCard", "IconButton", "ChevronDownIcon", "ThickCheckIcon", "ThickChevronRightIcon", "ThickDividerHorizontalIcon", "Inset", "Kbd", "Link", "Popover", "Portal", "Progress", "Quote", "RadioCards", "RadioGroup", "Radio", "Reset", "ScrollArea", "SegmentedControl", "Section", "Select", "Separator", "Skeleton", "Slider", "Slot", "Slottable", "Spinner", "Strong", "Switch", "TabNav", "Table", "Tabs", "TextArea", "TextField", "Text", "ThemePanel", "Theme", "ThemeContext", "useThemeContext", "Tooltip", "VisuallyHidden"]
|
|
4
|
+
"sourcesContent": ["export { AccessibleIcon, type AccessibleIconProps } from './accessible-icon.js';\nexport * as AlertDialog from './alert-dialog.js';\nexport { AspectRatio, type AspectRatioProps } from './aspect-ratio.js';\nexport { Avatar, type AvatarProps } from './avatar.js';\nexport { Badge, type BadgeProps } from './badge.js';\nexport { Blockquote, type BlockquoteProps } from './blockquote.js';\nexport { Box, type BoxProps } from './box.js';\nexport { Button, type ButtonProps } from './button.js';\nexport * as Callout from './callout.js';\nexport { Card, type CardProps } from './card.js';\nexport * as CheckboxCards from './checkbox-cards.js';\nexport * as CheckboxGroup from './checkbox-group.js';\nexport { Checkbox, type CheckboxProps } from './checkbox.js';\nexport { Code, type CodeProps } from './code.js';\nexport { Container, type ContainerProps } from './container.js';\nexport * as ContextMenu from './context-menu.js';\nexport * as DataList from './data-list.js';\nexport * as Dialog from './dialog.js';\nexport * as DropdownMenu from './dropdown-menu.js';\nexport { Em, type EmProps } from './em.js';\nexport { Flex, type FlexProps } from './flex.js';\nexport { Grid, type GridProps } from './grid.js';\nexport { Heading, type HeadingProps } from './heading.js';\nexport * as HoverCard from './hover-card.js';\nexport { IconButton, type IconButtonProps } from './icon-button.js';\nexport {\n type IconProps,\n ChevronDownIcon,\n ThickCheckIcon,\n ThickChevronRightIcon,\n ThickDividerHorizontalIcon,\n} from './icons.js';\nexport { Inset, type InsetProps } from './inset.js';\nexport { Kbd, type KbdProps } from './kbd.js';\nexport { Link, type LinkProps } from './link.js';\nexport * as Popover from './popover.js';\nexport { Portal, type PortalProps } from './portal.js';\nexport { Progress, type ProgressProps } from './progress.js';\nexport { Quote, type QuoteProps } from './quote.js';\nexport * as RadioCards from './radio-cards.js';\nexport * as RadioGroup from './radio-group.js';\nexport { Radio, type RadioProps } from './radio.js';\nexport { Reset, type ResetProps } from './reset.js';\nexport { ScrollArea, type ScrollAreaProps } from './scroll-area.js';\nexport * as SegmentedControl from './segmented-control.js';\nexport { Section, type SectionProps } from './section.js';\nexport * as Select from './select.js';\nexport { Separator, type SeparatorProps } from './separator.js';\nexport { Skeleton, type SkeletonProps } from './skeleton.js';\nexport { Slider, type SliderProps } from './slider.js';\nexport { Slot, Slottable } from './slot.js';\nexport { Spinner, type SpinnerProps } from './spinner.js';\nexport { Strong, type StrongProps } from './strong.js';\nexport { Switch, type SwitchProps } from './switch.js';\nexport * as TabNav from './tab-nav.js';\nexport * as Table from './table.js';\nexport * as Tabs from './tabs.js';\nexport { TextArea, type TextAreaProps } from './text-area.js';\nexport * as TextField from './text-field.js';\nexport { Text, type TextProps } from './text.js';\nexport { ThemePanel, type ThemePanelProps } from './theme-panel.js';\nexport { Theme, ThemeContext, type ThemeProps, useThemeContext } from './theme.js';\nexport { ToggleButton, type ToggleButtonProps } from './toggle-button.js';\nexport { ToggleIconButton, type ToggleIconButtonProps } from './toggle-icon-button.js';\nexport { Tooltip, type TooltipProps } from './tooltip.js';\nexport { VisuallyHidden, type VisuallyHiddenProps } from './visually-hidden.js';\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,kBAAAA,MAAgD,uBACzD,UAAYC,MAAiB,oBAC7B,OAAS,eAAAC,MAA0C,oBACnD,OAAS,UAAAC,MAAgC,cACzC,OAAS,SAAAC,MAA8B,aACvC,OAAS,cAAAC,MAAwC,kBACjD,OAAS,OAAAC,MAA0B,WACnC,OAAS,UAAAC,MAAgC,cACzC,UAAYC,MAAa,eACzB,OAAS,QAAAC,MAA4B,YACrC,UAAYC,MAAmB,sBAC/B,UAAYC,MAAmB,sBAC/B,OAAS,YAAAC,MAAoC,gBAC7C,OAAS,QAAAC,MAA4B,YACrC,OAAS,aAAAC,MAAsC,iBAC/C,UAAYC,MAAiB,oBAC7B,UAAYC,MAAc,iBAC1B,UAAYC,MAAY,cACxB,UAAYC,MAAkB,qBAC9B,OAAS,MAAAC,MAAwB,UACjC,OAAS,QAAAC,MAA4B,YACrC,OAAS,QAAAC,MAA4B,YACrC,OAAS,WAAAC,MAAkC,eAC3C,UAAYC,MAAe,kBAC3B,OAAS,cAAAC,MAAwC,mBACjD,OAEE,mBAAAC,EACA,kBAAAC,EACA,yBAAAC,EACA,8BAAAC,MACK,aACP,OAAS,SAAAC,MAA8B,aACvC,OAAS,OAAAC,MAA0B,WACnC,OAAS,QAAAC,MAA4B,YACrC,UAAYC,MAAa,eACzB,OAAS,UAAAC,OAAgC,cACzC,OAAS,YAAAC,OAAoC,gBAC7C,OAAS,SAAAC,OAA8B,aACvC,UAAYC,OAAgB,mBAC5B,UAAYC,OAAgB,mBAC5B,OAAS,SAAAC,OAA8B,aACvC,OAAS,SAAAC,OAA8B,aACvC,OAAS,cAAAC,OAAwC,mBACjD,UAAYC,OAAsB,yBAClC,OAAS,WAAAC,OAAkC,eAC3C,UAAYC,OAAY,cACxB,OAAS,aAAAC,OAAsC,iBAC/C,OAAS,YAAAC,OAAoC,gBAC7C,OAAS,UAAAC,OAAgC,cACzC,OAAS,QAAAC,GAAM,aAAAC,OAAiB,YAChC,OAAS,WAAAC,OAAkC,eAC3C,OAAS,UAAAC,OAAgC,cACzC,OAAS,UAAAC,OAAgC,cACzC,UAAYC,OAAY,eACxB,UAAYC,OAAW,aACvB,UAAYC,OAAU,YACtB,OAAS,YAAAC,OAAoC,iBAC7C,UAAYC,OAAe,kBAC3B,OAAS,QAAAC,OAA4B,YACrC,OAAS,cAAAC,OAAwC,mBACjD,OAAS,SAAAC,GAAO,gBAAAC,GAA+B,mBAAAC,OAAuB,aACtE,OAAS,gBAAAC,OAA4C,qBACrD,OAAS,oBAAAC,OAAoD,0BAC7D,OAAS,WAAAC,OAAkC,eAC3C,OAAS,kBAAAC,OAAgD",
|
|
6
|
+
"names": ["AccessibleIcon", "AlertDialog", "AspectRatio", "Avatar", "Badge", "Blockquote", "Box", "Button", "Callout", "Card", "CheckboxCards", "CheckboxGroup", "Checkbox", "Code", "Container", "ContextMenu", "DataList", "Dialog", "DropdownMenu", "Em", "Flex", "Grid", "Heading", "HoverCard", "IconButton", "ChevronDownIcon", "ThickCheckIcon", "ThickChevronRightIcon", "ThickDividerHorizontalIcon", "Inset", "Kbd", "Link", "Popover", "Portal", "Progress", "Quote", "RadioCards", "RadioGroup", "Radio", "Reset", "ScrollArea", "SegmentedControl", "Section", "Select", "Separator", "Skeleton", "Slider", "Slot", "Slottable", "Spinner", "Strong", "Switch", "TabNav", "Table", "Tabs", "TextArea", "TextField", "Text", "ThemePanel", "Theme", "ThemeContext", "useThemeContext", "ToggleButton", "ToggleIconButton", "Tooltip", "VisuallyHidden"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Button } from './button.js';
|
|
3
|
+
interface ToggleButtonProps extends React.ComponentPropsWithoutRef<typeof Button> {
|
|
4
|
+
pressed?: boolean;
|
|
5
|
+
onPressedChange?: (pressed: boolean) => void;
|
|
6
|
+
defaultPressed?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const ToggleButton: React.ForwardRefExoticComponent<Omit<ToggleButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
export { ToggleButton };
|
|
10
|
+
export type { ToggleButtonProps };
|
|
11
|
+
//# sourceMappingURL=toggle-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-button.d.ts","sourceRoot":"","sources":["../../../src/components/toggle-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,UAAU,iBAAkB,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,MAAM,CAAC;IAC/E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAID,QAAA,MAAM,YAAY,0GAajB,CAAC;AAGF,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,YAAY,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as e from"react";import{Toggle as l}from"radix-ui";import{Button as p}from"./button.js";const o=e.forwardRef(({pressed:t,onPressedChange:n,defaultPressed:r,...s},g)=>e.createElement(l.Root,{pressed:t,onPressedChange:n,defaultPressed:r,asChild:!0},e.createElement(p,{...s,ref:g})));o.displayName="ToggleButton";export{o as ToggleButton};
|
|
2
|
+
//# sourceMappingURL=toggle-button.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/toggle-button.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport { Toggle } from 'radix-ui';\nimport { Button } from './button.js';\n\ninterface ToggleButtonProps extends React.ComponentPropsWithoutRef<typeof Button> {\n pressed?: boolean;\n onPressedChange?: (pressed: boolean) => void;\n defaultPressed?: boolean;\n}\n\ntype ToggleButtonElement = React.ElementRef<typeof Button>;\n\nconst ToggleButton = React.forwardRef<ToggleButtonElement, ToggleButtonProps>(\n ({ pressed, onPressedChange, defaultPressed, ...buttonProps }, forwardedRef) => {\n return (\n <Toggle.Root\n pressed={pressed}\n onPressedChange={onPressedChange}\n defaultPressed={defaultPressed}\n asChild\n >\n <Button {...buttonProps} ref={forwardedRef} />\n </Toggle.Root>\n );\n },\n);\nToggleButton.displayName = 'ToggleButton';\n\nexport { ToggleButton };\nexport type { ToggleButtonProps };\n"],
|
|
5
|
+
"mappings": "AAAA,UAAYA,MAAW,QACvB,OAAS,UAAAC,MAAc,WACvB,OAAS,UAAAC,MAAc,cAUvB,MAAMC,EAAeH,EAAM,WACzB,CAAC,CAAE,QAAAI,EAAS,gBAAAC,EAAiB,eAAAC,EAAgB,GAAGC,CAAY,EAAGC,IAE3DR,EAAA,cAACC,EAAO,KAAP,CACC,QAASG,EACT,gBAAiBC,EACjB,eAAgBC,EAChB,QAAO,IAEPN,EAAA,cAACE,EAAA,CAAQ,GAAGK,EAAa,IAAKC,EAAc,CAC9C,CAGN,EACAL,EAAa,YAAc",
|
|
6
|
+
"names": ["React", "Toggle", "Button", "ToggleButton", "pressed", "onPressedChange", "defaultPressed", "buttonProps", "forwardedRef"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IconButton } from './icon-button.js';
|
|
3
|
+
interface ToggleIconButtonProps extends React.ComponentPropsWithoutRef<typeof IconButton> {
|
|
4
|
+
pressed?: boolean;
|
|
5
|
+
onPressedChange?: (pressed: boolean) => void;
|
|
6
|
+
defaultPressed?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const ToggleIconButton: React.ForwardRefExoticComponent<Omit<ToggleIconButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
export { ToggleIconButton };
|
|
10
|
+
export type { ToggleIconButtonProps };
|
|
11
|
+
//# sourceMappingURL=toggle-icon-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-icon-button.d.ts","sourceRoot":"","sources":["../../../src/components/toggle-icon-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,UAAU,qBAAsB,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,UAAU,CAAC;IACvF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAID,QAAA,MAAM,gBAAgB,8GAarB,CAAC;AAGF,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC5B,YAAY,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as o from"react";import{Toggle as l}from"radix-ui";import{IconButton as p}from"./icon-button.js";const e=o.forwardRef(({pressed:t,onPressedChange:n,defaultPressed:r,...s},g)=>o.createElement(l.Root,{pressed:t,onPressedChange:n,defaultPressed:r,asChild:!0},o.createElement(p,{...s,ref:g})));e.displayName="ToggleIconButton";export{e as ToggleIconButton};
|
|
2
|
+
//# sourceMappingURL=toggle-icon-button.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/toggle-icon-button.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport { Toggle } from 'radix-ui';\nimport { IconButton } from './icon-button.js';\n\ninterface ToggleIconButtonProps extends React.ComponentPropsWithoutRef<typeof IconButton> {\n pressed?: boolean;\n onPressedChange?: (pressed: boolean) => void;\n defaultPressed?: boolean;\n}\n\ntype ToggleIconButtonElement = React.ElementRef<typeof IconButton>;\n\nconst ToggleIconButton = React.forwardRef<ToggleIconButtonElement, ToggleIconButtonProps>(\n ({ pressed, onPressedChange, defaultPressed, ...iconButtonProps }, forwardedRef) => {\n return (\n <Toggle.Root\n pressed={pressed}\n onPressedChange={onPressedChange}\n defaultPressed={defaultPressed}\n asChild\n >\n <IconButton {...iconButtonProps} ref={forwardedRef} />\n </Toggle.Root>\n );\n },\n);\nToggleIconButton.displayName = 'ToggleIconButton';\n\nexport { ToggleIconButton };\nexport type { ToggleIconButtonProps };\n"],
|
|
5
|
+
"mappings": "AAAA,UAAYA,MAAW,QACvB,OAAS,UAAAC,MAAc,WACvB,OAAS,cAAAC,MAAkB,mBAU3B,MAAMC,EAAmBH,EAAM,WAC7B,CAAC,CAAE,QAAAI,EAAS,gBAAAC,EAAiB,eAAAC,EAAgB,GAAGC,CAAgB,EAAGC,IAE/DR,EAAA,cAACC,EAAO,KAAP,CACC,QAASG,EACT,gBAAiBC,EACjB,eAAgBC,EAChB,QAAO,IAEPN,EAAA,cAACE,EAAA,CAAY,GAAGK,EAAiB,IAAKC,EAAc,CACtD,CAGN,EACAL,EAAiB,YAAc",
|
|
6
|
+
"names": ["React", "Toggle", "IconButton", "ToggleIconButton", "pressed", "onPressedChange", "defaultPressed", "iconButtonProps", "forwardedRef"]
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -21,6 +21,11 @@
|
|
|
21
21
|
height: var(--base-button-height);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
.rt-BaseButton:where(.rt-full-width) {
|
|
25
|
+
display: flex;
|
|
26
|
+
width: 100%;
|
|
27
|
+
}
|
|
28
|
+
|
|
24
29
|
/***************************************************************************************************
|
|
25
30
|
* *
|
|
26
31
|
* SIZES *
|
|
@@ -346,3 +351,58 @@
|
|
|
346
351
|
background-color: var(--gray-a2);
|
|
347
352
|
}
|
|
348
353
|
}
|
|
354
|
+
|
|
355
|
+
/***************************************************************************************************
|
|
356
|
+
* *
|
|
357
|
+
* TOGGLE PRESSED STATES *
|
|
358
|
+
* *
|
|
359
|
+
***************************************************************************************************/
|
|
360
|
+
|
|
361
|
+
/* Toggle button pressed states for all variants */
|
|
362
|
+
.rt-BaseButton:where([data-state='on']) {
|
|
363
|
+
/* Classic variant pressed */
|
|
364
|
+
&:where(.rt-variant-classic) {
|
|
365
|
+
background: linear-gradient(to bottom, var(--accent-10), var(--accent-11));
|
|
366
|
+
box-shadow: var(--base-button-classic-hover-shadow);
|
|
367
|
+
|
|
368
|
+
&:where(.rt-high-contrast) {
|
|
369
|
+
background: linear-gradient(to bottom, var(--accent-11), var(--accent-12));
|
|
370
|
+
filter: contrast(0.88) saturate(1.1) brightness(1.1);
|
|
371
|
+
|
|
372
|
+
&:where(:not([data-accent-color='gray'])) {
|
|
373
|
+
background: var(--accent-12);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/* Solid variant pressed */
|
|
379
|
+
&:where(.rt-variant-solid) {
|
|
380
|
+
background-color: var(--accent-10);
|
|
381
|
+
|
|
382
|
+
&:where(.rt-high-contrast) {
|
|
383
|
+
background-color: var(--accent-12);
|
|
384
|
+
filter: var(--base-button-solid-high-contrast-hover-filter);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/* Soft variant pressed */
|
|
389
|
+
&:where(.rt-variant-soft) {
|
|
390
|
+
background-color: var(--accent-a5);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/* Ghost variant pressed */
|
|
394
|
+
&:where(.rt-variant-ghost) {
|
|
395
|
+
background-color: var(--accent-a4);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
/* Outline variant pressed */
|
|
399
|
+
&:where(.rt-variant-outline) {
|
|
400
|
+
background-color: var(--accent-a3);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
/* Surface variant pressed */
|
|
404
|
+
&:where(.rt-variant-surface) {
|
|
405
|
+
background-color: var(--accent-a3);
|
|
406
|
+
box-shadow: inset 0 0 0 1px var(--accent-a8);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
@@ -16,10 +16,12 @@ const baseButtonPropDefs = {
|
|
|
16
16
|
...highContrastPropDef,
|
|
17
17
|
...radiusPropDef,
|
|
18
18
|
loading: { type: 'boolean', className: 'rt-loading', default: false },
|
|
19
|
+
fullWidth: { type: 'boolean', className: 'rt-full-width', default: false },
|
|
19
20
|
} satisfies {
|
|
20
21
|
size: PropDef<(typeof sizes)[number]>;
|
|
21
22
|
variant: PropDef<(typeof variants)[number]>;
|
|
22
23
|
loading: PropDef<boolean>;
|
|
24
|
+
fullWidth: PropDef<boolean>;
|
|
23
25
|
};
|
|
24
26
|
|
|
25
27
|
export { baseButtonPropDefs };
|
|
@@ -16,22 +16,36 @@ import type { GetPropDefTypes } from '../../props/prop-def.js';
|
|
|
16
16
|
|
|
17
17
|
type BaseButtonElement = React.ElementRef<'button'>;
|
|
18
18
|
type BaseButtonOwnProps = GetPropDefTypes<typeof baseButtonPropDefs>;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
|
|
20
|
+
// Polymorphic types
|
|
21
|
+
type PolymorphicBaseButtonProps<C extends React.ElementType = 'button'> = {
|
|
22
|
+
as?: C;
|
|
23
|
+
} & BaseButtonOwnProps &
|
|
24
|
+
MarginProps &
|
|
25
|
+
Omit<React.ComponentPropsWithoutRef<C>, keyof BaseButtonOwnProps | keyof MarginProps | 'as'>;
|
|
26
|
+
|
|
27
|
+
interface BaseButtonProps extends PolymorphicBaseButtonProps {}
|
|
28
|
+
|
|
23
29
|
const BaseButton = React.forwardRef<BaseButtonElement, BaseButtonProps>((props, forwardedRef) => {
|
|
24
30
|
const { size = baseButtonPropDefs.size.default } = props;
|
|
25
31
|
const {
|
|
26
32
|
className,
|
|
27
33
|
children,
|
|
28
34
|
asChild,
|
|
35
|
+
as,
|
|
29
36
|
color,
|
|
30
37
|
radius,
|
|
31
38
|
disabled = props.loading,
|
|
32
39
|
...baseButtonProps
|
|
33
40
|
} = extractProps(props, baseButtonPropDefs, marginPropDefs);
|
|
34
|
-
|
|
41
|
+
|
|
42
|
+
// asChild takes precedence over as prop
|
|
43
|
+
const Comp = asChild ? Slot.Root : as || 'button';
|
|
44
|
+
|
|
45
|
+
// Only pass disabled for elements that support it
|
|
46
|
+
const shouldPassDisabled =
|
|
47
|
+
asChild || !as || ['button', 'input', 'textarea', 'select'].includes(as);
|
|
48
|
+
|
|
35
49
|
return (
|
|
36
50
|
<Comp
|
|
37
51
|
// The `data-disabled` attribute enables correct styles when doing `<Button asChild disabled>`
|
|
@@ -41,7 +55,7 @@ const BaseButton = React.forwardRef<BaseButtonElement, BaseButtonProps>((props,
|
|
|
41
55
|
{...baseButtonProps}
|
|
42
56
|
ref={forwardedRef}
|
|
43
57
|
className={classNames('rt-reset', 'rt-BaseButton', className)}
|
|
44
|
-
|
|
58
|
+
{...(shouldPassDisabled && { disabled })}
|
|
45
59
|
>
|
|
46
60
|
{props.loading ? (
|
|
47
61
|
<>
|
|
@@ -2,14 +2,27 @@ import * as React from 'react';
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
|
|
4
4
|
import { BaseButton } from './_internal/base-button.js';
|
|
5
|
+
import type { BaseButtonProps } from './_internal/base-button.js';
|
|
5
6
|
|
|
6
7
|
type ButtonElement = React.ElementRef<typeof BaseButton>;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
|
|
9
|
+
// Polymorphic Button props
|
|
10
|
+
type ButtonOwnProps = Omit<BaseButtonProps, 'as'>;
|
|
11
|
+
|
|
12
|
+
type ButtonProps<C extends React.ElementType = 'button'> = ButtonOwnProps & {
|
|
13
|
+
as?: C;
|
|
14
|
+
} & Omit<React.ComponentPropsWithoutRef<C>, keyof ButtonOwnProps>;
|
|
15
|
+
|
|
16
|
+
type ButtonComponent = <C extends React.ElementType = 'button'>(
|
|
17
|
+
props: ButtonProps<C> & { ref?: React.ForwardedRef<ButtonElement> },
|
|
18
|
+
) => React.ReactElement | null;
|
|
19
|
+
|
|
20
|
+
const Button = React.forwardRef(
|
|
21
|
+
({ className, ...props }: ButtonProps, forwardedRef: React.ForwardedRef<ButtonElement>) => (
|
|
10
22
|
<BaseButton {...props} ref={forwardedRef} className={classNames('rt-Button', className)} />
|
|
11
|
-
)
|
|
12
|
-
);
|
|
23
|
+
),
|
|
24
|
+
) as ButtonComponent & { displayName?: string };
|
|
25
|
+
|
|
13
26
|
Button.displayName = 'Button';
|
|
14
27
|
|
|
15
28
|
export { Button };
|
|
@@ -2,14 +2,30 @@ import * as React from 'react';
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
|
|
4
4
|
import { BaseButton } from './_internal/base-button.js';
|
|
5
|
+
import type { BaseButtonProps } from './_internal/base-button.js';
|
|
5
6
|
|
|
6
7
|
type IconButtonElement = React.ElementRef<typeof BaseButton>;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
|
|
9
|
+
// Polymorphic IconButton props
|
|
10
|
+
type IconButtonOwnProps = Omit<BaseButtonProps, 'as'>;
|
|
11
|
+
|
|
12
|
+
type IconButtonProps<C extends React.ElementType = 'button'> = IconButtonOwnProps & {
|
|
13
|
+
as?: C;
|
|
14
|
+
} & Omit<React.ComponentPropsWithoutRef<C>, keyof IconButtonOwnProps>;
|
|
15
|
+
|
|
16
|
+
type IconButtonComponent = <C extends React.ElementType = 'button'>(
|
|
17
|
+
props: IconButtonProps<C> & { ref?: React.ForwardedRef<IconButtonElement> },
|
|
18
|
+
) => React.ReactElement | null;
|
|
19
|
+
|
|
20
|
+
const IconButton = React.forwardRef(
|
|
21
|
+
(
|
|
22
|
+
{ className, ...props }: IconButtonProps,
|
|
23
|
+
forwardedRef: React.ForwardedRef<IconButtonElement>,
|
|
24
|
+
) => (
|
|
10
25
|
<BaseButton {...props} ref={forwardedRef} className={classNames('rt-IconButton', className)} />
|
|
11
|
-
)
|
|
12
|
-
);
|
|
26
|
+
),
|
|
27
|
+
) as IconButtonComponent & { displayName?: string };
|
|
28
|
+
|
|
13
29
|
IconButton.displayName = 'IconButton';
|
|
14
30
|
|
|
15
31
|
export { IconButton };
|
package/src/components/index.tsx
CHANGED
|
@@ -60,5 +60,7 @@ export * as TextField from './text-field.js';
|
|
|
60
60
|
export { Text, type TextProps } from './text.js';
|
|
61
61
|
export { ThemePanel, type ThemePanelProps } from './theme-panel.js';
|
|
62
62
|
export { Theme, ThemeContext, type ThemeProps, useThemeContext } from './theme.js';
|
|
63
|
+
export { ToggleButton, type ToggleButtonProps } from './toggle-button.js';
|
|
64
|
+
export { ToggleIconButton, type ToggleIconButtonProps } from './toggle-icon-button.js';
|
|
63
65
|
export { Tooltip, type TooltipProps } from './tooltip.js';
|
|
64
66
|
export { VisuallyHidden, type VisuallyHiddenProps } from './visually-hidden.js';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Toggle } from 'radix-ui';
|
|
3
|
+
import { Button } from './button.js';
|
|
4
|
+
|
|
5
|
+
interface ToggleButtonProps extends React.ComponentPropsWithoutRef<typeof Button> {
|
|
6
|
+
pressed?: boolean;
|
|
7
|
+
onPressedChange?: (pressed: boolean) => void;
|
|
8
|
+
defaultPressed?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
type ToggleButtonElement = React.ElementRef<typeof Button>;
|
|
12
|
+
|
|
13
|
+
const ToggleButton = React.forwardRef<ToggleButtonElement, ToggleButtonProps>(
|
|
14
|
+
({ pressed, onPressedChange, defaultPressed, ...buttonProps }, forwardedRef) => {
|
|
15
|
+
return (
|
|
16
|
+
<Toggle.Root
|
|
17
|
+
pressed={pressed}
|
|
18
|
+
onPressedChange={onPressedChange}
|
|
19
|
+
defaultPressed={defaultPressed}
|
|
20
|
+
asChild
|
|
21
|
+
>
|
|
22
|
+
<Button {...buttonProps} ref={forwardedRef} />
|
|
23
|
+
</Toggle.Root>
|
|
24
|
+
);
|
|
25
|
+
},
|
|
26
|
+
);
|
|
27
|
+
ToggleButton.displayName = 'ToggleButton';
|
|
28
|
+
|
|
29
|
+
export { ToggleButton };
|
|
30
|
+
export type { ToggleButtonProps };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Toggle } from 'radix-ui';
|
|
3
|
+
import { IconButton } from './icon-button.js';
|
|
4
|
+
|
|
5
|
+
interface ToggleIconButtonProps extends React.ComponentPropsWithoutRef<typeof IconButton> {
|
|
6
|
+
pressed?: boolean;
|
|
7
|
+
onPressedChange?: (pressed: boolean) => void;
|
|
8
|
+
defaultPressed?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
type ToggleIconButtonElement = React.ElementRef<typeof IconButton>;
|
|
12
|
+
|
|
13
|
+
const ToggleIconButton = React.forwardRef<ToggleIconButtonElement, ToggleIconButtonProps>(
|
|
14
|
+
({ pressed, onPressedChange, defaultPressed, ...iconButtonProps }, forwardedRef) => {
|
|
15
|
+
return (
|
|
16
|
+
<Toggle.Root
|
|
17
|
+
pressed={pressed}
|
|
18
|
+
onPressedChange={onPressedChange}
|
|
19
|
+
defaultPressed={defaultPressed}
|
|
20
|
+
asChild
|
|
21
|
+
>
|
|
22
|
+
<IconButton {...iconButtonProps} ref={forwardedRef} />
|
|
23
|
+
</Toggle.Root>
|
|
24
|
+
);
|
|
25
|
+
},
|
|
26
|
+
);
|
|
27
|
+
ToggleIconButton.displayName = 'ToggleIconButton';
|
|
28
|
+
|
|
29
|
+
export { ToggleIconButton };
|
|
30
|
+
export type { ToggleIconButtonProps };
|
package/styles.css
CHANGED
|
@@ -6553,6 +6553,10 @@
|
|
|
6553
6553
|
.rt-BaseButton:where(.rt-loading) {
|
|
6554
6554
|
position: relative;
|
|
6555
6555
|
}
|
|
6556
|
+
.rt-BaseButton:where(.rt-full-width) {
|
|
6557
|
+
display: flex;
|
|
6558
|
+
width: 100%;
|
|
6559
|
+
}
|
|
6556
6560
|
.rt-BaseButton:where(.rt-r-size-1) {
|
|
6557
6561
|
--base-button-classic-active-padding-top: 1px;
|
|
6558
6562
|
--base-button-height: var(--space-5);
|
|
@@ -6905,6 +6909,37 @@
|
|
|
6905
6909
|
box-shadow: inset 0 0 0 1px var(--gray-a6);
|
|
6906
6910
|
background-color: var(--gray-a2);
|
|
6907
6911
|
}
|
|
6912
|
+
.rt-BaseButton:where([data-state='on']):where(.rt-variant-classic) {
|
|
6913
|
+
background: linear-gradient(to bottom, var(--accent-10), var(--accent-11));
|
|
6914
|
+
box-shadow: var(--base-button-classic-hover-shadow);
|
|
6915
|
+
}
|
|
6916
|
+
.rt-BaseButton:where([data-state='on']):where(.rt-variant-classic):where(.rt-high-contrast) {
|
|
6917
|
+
background: linear-gradient(to bottom, var(--accent-11), var(--accent-12));
|
|
6918
|
+
filter: contrast(0.88) saturate(1.1) brightness(1.1);
|
|
6919
|
+
}
|
|
6920
|
+
.rt-BaseButton:where([data-state='on']):where(.rt-variant-classic):where(.rt-high-contrast):where(:not([data-accent-color='gray'])) {
|
|
6921
|
+
background: var(--accent-12);
|
|
6922
|
+
}
|
|
6923
|
+
.rt-BaseButton:where([data-state='on']):where(.rt-variant-solid) {
|
|
6924
|
+
background-color: var(--accent-10);
|
|
6925
|
+
}
|
|
6926
|
+
.rt-BaseButton:where([data-state='on']):where(.rt-variant-solid):where(.rt-high-contrast) {
|
|
6927
|
+
background-color: var(--accent-12);
|
|
6928
|
+
filter: var(--base-button-solid-high-contrast-hover-filter);
|
|
6929
|
+
}
|
|
6930
|
+
.rt-BaseButton:where([data-state='on']):where(.rt-variant-soft) {
|
|
6931
|
+
background-color: var(--accent-a5);
|
|
6932
|
+
}
|
|
6933
|
+
.rt-BaseButton:where([data-state='on']):where(.rt-variant-ghost) {
|
|
6934
|
+
background-color: var(--accent-a4);
|
|
6935
|
+
}
|
|
6936
|
+
.rt-BaseButton:where([data-state='on']):where(.rt-variant-outline) {
|
|
6937
|
+
background-color: var(--accent-a3);
|
|
6938
|
+
}
|
|
6939
|
+
.rt-BaseButton:where([data-state='on']):where(.rt-variant-surface) {
|
|
6940
|
+
background-color: var(--accent-a3);
|
|
6941
|
+
box-shadow: inset 0 0 0 1px var(--accent-a8);
|
|
6942
|
+
}
|
|
6908
6943
|
.rt-Button:where(:not(.rt-variant-ghost)) :where(svg) {
|
|
6909
6944
|
opacity: 0.9;
|
|
6910
6945
|
}
|