autocasting-ui-library-padimasso 1.4.2 → 1.4.3
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/components/DataDisplay/Chips/ChoiceChip.js +10 -0
- package/dist/components/DataDisplay/Chips/StatusChip.js +16 -0
- package/dist/components/DataDisplay/Chips/TagChip.js +13 -0
- package/dist/components/Feedback/Status/Chip/InputChip.js +13 -0
- package/dist/components/Feedback/Status/Chip/index.js +7 -0
- package/dist/components/Navigation/Selection/ChoiceChip/ChoiceChip.js +10 -0
- package/dist/components/Navigation/Selection/ProfessionChip/ProfessionChip.js +10 -0
- package/dist/components/Navigation/Selection/ProfessionChip/index.js +5 -0
- package/dist/components/Navigation/Selection/SelectableChip/SelectableChip.js +10 -0
- package/dist/components/Navigation/Selection/SelectableChip/index.js +8 -0
- package/dist/index.d.ts +10 -4
- package/dist/index.js +3 -2
- package/package.json +1 -1
- package/src/components/DataDisplay/Chips/ChoiceChip.stories.tsx +33 -0
- package/src/components/DataDisplay/Chips/ChoiceChip.tsx +26 -0
- package/src/components/{Feedback/Status/Chip → DataDisplay/Chips}/StatusChip.stories.tsx +1 -1
- package/src/components/DataDisplay/Chips/TagChip.stories.tsx +22 -0
- package/src/components/{Feedback/Status/Chip/Chip.tsx → DataDisplay/Chips/TagChip.tsx} +4 -4
- package/src/components/DataDisplay/Chips/index.ts +8 -0
- package/src/index.ts +1 -1
- package/src/components/Feedback/Status/Chip/Chip.stories.tsx +0 -28
- package/src/components/Feedback/Status/Chip/index.ts +0 -3
- /package/src/components/{Feedback/Status/Chip → DataDisplay/Chips}/StatusChip.tsx +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
|
|
4
|
+
function ChoiceChip({ label, selected = false, className, type = 'button', ...rest }) {
|
|
5
|
+
return (jsx("button", { type: type, className: clsx('px-4 py-1 rounded-full whitespace-nowrap cursor-pointer bg-transparent border-1', selected
|
|
6
|
+
? 'text-(--color-primary-purple) border-(--color-primary-purple)'
|
|
7
|
+
: 'text-(--color-secondary-grey-fonts) border-(--color-secondary-outline)', className), "aria-pressed": selected, ...rest, children: label }));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { ChoiceChip as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
function StatusChip({ label, dotColor, variant = 'bordered', align = 'inline', className, }) {
|
|
4
|
+
const baseClasses = 'inline-flex items-center gap-2';
|
|
5
|
+
const borderedClasses = 'rounded-xl border px-3 py-1 bg-(--color-primary-white) border-(--color-secondary-outline) text-(--color-primary-black)';
|
|
6
|
+
const inlineClasses = 'text-(--color-primary-black)';
|
|
7
|
+
const alignClasses = align === 'spaced' ? 'w-full justify-between' : '';
|
|
8
|
+
return (jsxs("span", { className: [
|
|
9
|
+
baseClasses,
|
|
10
|
+
alignClasses,
|
|
11
|
+
variant === 'bordered' ? borderedClasses : inlineClasses,
|
|
12
|
+
className ?? '',
|
|
13
|
+
].join(' '), children: [jsx("span", { className: "text-sm", children: label }), dotColor ? (jsx("span", { className: "inline-block h-4 w-4 shrink-0 rounded-full", style: { background: dotColor }, "aria-hidden": "true" })) : null] }));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { StatusChip as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Icon } from '../../Brand/Identity/Icon/Icon.js';
|
|
3
|
+
|
|
4
|
+
function TagChip({ label, onRemove, newItem = false }) {
|
|
5
|
+
return (jsxs("span", { className: [
|
|
6
|
+
'inline-flex items-center gap-[6px] rounded-xl border px-3 py-1 lg:text-[14px]',
|
|
7
|
+
newItem
|
|
8
|
+
? 'font-semibold bg-(--color-secondary-white) border-(--color-primary-purple) text-(--color-primary-purple)'
|
|
9
|
+
: 'bg-(--color-primary-white) border-(--color-secondary-outline) text-(--color-primary-black)',
|
|
10
|
+
].join(' '), children: [jsx("p", { className: "text-sm", children: label }), onRemove && jsx(Icon, { name: "cross", variant: "primary", size: 11, onClick: onRemove })] }));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { TagChip as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Icon } from '../../../Brand/Identity/Icon/Icon.js';
|
|
3
|
+
|
|
4
|
+
function InputChip({ label, onRemove, newItem = false }) {
|
|
5
|
+
return (jsxs("span", { className: [
|
|
6
|
+
'flex items-center gap-[6px] rounded-xl border px-3 py-1 lg:text-[14px]',
|
|
7
|
+
newItem
|
|
8
|
+
? 'font-semibold bg-(--color-secondary-white) border-(--color-primary-purple) text-(--color-primary-purple)'
|
|
9
|
+
: 'bg-(--color-primary-white) border-(--color-secondary-outline) text-(--color-primary-black)',
|
|
10
|
+
].join(' '), children: [jsx("p", { className: "text-sm", children: label }), onRemove && jsx(Icon, { name: "cross", variant: "primary", size: 11, onClick: onRemove })] }));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { InputChip as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
|
|
4
|
+
function ChoiceChip({ label, selected = false, className, type = 'button', ...rest }) {
|
|
5
|
+
return (jsx("button", { type: type, className: clsx('px-4 py-1 rounded-full whitespace-nowrap cursor-pointer bg-transparent border-1', selected
|
|
6
|
+
? 'text-(--color-primary-purple) border-(--color-primary-purple)'
|
|
7
|
+
: 'text-(--color-secondary-grey-fonts) border-(--color-secondary-outline)', className), "aria-pressed": selected, ...rest, children: label }));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { ChoiceChip as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
|
|
4
|
+
function ProfessionChip({ label, selected = false, className, type = 'button', ...rest }) {
|
|
5
|
+
return (jsx("button", { type: type, className: clsx('px-4 py-1 rounded-full whitespace-nowrap cursor-pointer bg-transparent border-1', selected
|
|
6
|
+
? 'text-(--color-primary-purple) border-(--color-primary-purple)'
|
|
7
|
+
: 'text-(--color-secondary-grey-fonts) border-(--color-secondary-outline)', className), "aria-pressed": selected, ...rest, children: label }));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { ProfessionChip as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
|
|
4
|
+
function SelectableChip({ label, selected = false, className, type = 'button', ...rest }) {
|
|
5
|
+
return (jsx("button", { type: type, className: clsx('px-4 py-1 rounded-full whitespace-nowrap cursor-pointer bg-transparent border-1', selected
|
|
6
|
+
? 'text-(--color-primary-purple) border-(--color-primary-purple)'
|
|
7
|
+
: 'text-(--color-secondary-grey-fonts) border-(--color-secondary-outline)', className), "aria-pressed": selected, ...rest, children: label }));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { SelectableChip as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -192,12 +192,18 @@ type SpinnerProps = {
|
|
|
192
192
|
};
|
|
193
193
|
declare function Spinner({ color, strokeWidth, className, ariaLabel, arc, speedMs, }: SpinnerProps): react_jsx_runtime.JSX.Element;
|
|
194
194
|
|
|
195
|
-
type
|
|
195
|
+
type ChoiceChipProps = {
|
|
196
|
+
label: string;
|
|
197
|
+
selected?: boolean;
|
|
198
|
+
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'>;
|
|
199
|
+
declare function ChoiceChip({ label, selected, className, type, ...rest }: ChoiceChipProps): react_jsx_runtime.JSX.Element;
|
|
200
|
+
|
|
201
|
+
type TagChipProps = {
|
|
196
202
|
label: string;
|
|
197
203
|
onRemove?: () => void;
|
|
198
204
|
newItem?: boolean;
|
|
199
205
|
};
|
|
200
|
-
declare function
|
|
206
|
+
declare function TagChip({ label, onRemove, newItem }: TagChipProps): react_jsx_runtime.JSX.Element;
|
|
201
207
|
|
|
202
208
|
type StatusChipVariant = 'bordered' | 'inline';
|
|
203
209
|
type StatusChipAlign = 'inline' | 'spaced';
|
|
@@ -513,5 +519,5 @@ type WizardProps = {
|
|
|
513
519
|
};
|
|
514
520
|
declare function Wizard({ children }: WizardProps): ReactElement<WizardStepProps, string | React$1.JSXElementConstructor<any>>;
|
|
515
521
|
|
|
516
|
-
export { Button, ButtonRow, ChevronLeft, ChevronRight, ChevronUpDown,
|
|
517
|
-
export type { DataGridActions, DataGridColumn, DataGridPagination, DataGridSelection, IconName, IconVariant, OverflowMenuAlign, OverflowMenuItem, OverflowMenuSide, PillItem, ShowToastOptions, ToastContent, ToastContextValue, ToastPosition, ToastProps, ToastRecord, ToastType, TooltipPosition, TooltipProps, UniversalVideoPlayerProps, VideoProvider, WizardStepProps };
|
|
522
|
+
export { Button, ButtonRow, ChevronLeft, ChevronRight, ChevronUpDown, ChoiceChip, CurrencyInput, DataGrid, DetailsView, FormCurrencyField, FormInputField, FormPasswordField, FormSelectField, FullscreenCenter, GoogleButton, HilighterSvg, Icon, IconViewSwitcher, ImageCarousel, Input, Label, Logo, Modal, OverflowMenu, PasswordInput, PhotoZoomOverlay, Pills, SearchInput, SearchWithSuggestions, Select, Separator, Spinner, StatusChip, TagChip, TextDropdownTrigger, Toast, ToastProvider, Tooltip, UniversalVideoPlayer, UploadTile, VideoPreviewCard, Wizard, WizardStep, clearToasts, dismissToast, showToast, useDebouncedValue, useToast, useViewportVhVar };
|
|
523
|
+
export type { ChoiceChipProps, DataGridActions, DataGridColumn, DataGridPagination, DataGridSelection, IconName, IconVariant, OverflowMenuAlign, OverflowMenuItem, OverflowMenuSide, PillItem, ShowToastOptions, StatusChipProps, TagChipProps, ToastContent, ToastContextValue, ToastPosition, ToastProps, ToastRecord, ToastType, TooltipPosition, TooltipProps, UniversalVideoPlayerProps, VideoProvider, WizardStepProps };
|
package/dist/index.js
CHANGED
|
@@ -13,8 +13,9 @@ export { Icon } from './components/Brand/Identity/Icon/Icon.js';
|
|
|
13
13
|
export { default as HilighterSvg } from './components/Brand/Identity/Icon/HilighterSvg.js';
|
|
14
14
|
export { default as Logo } from './components/Brand/Identity/Logo/Logo.js';
|
|
15
15
|
export { default as Spinner } from './components/Feedback/Loading/Spinner/Spinner.js';
|
|
16
|
-
export { default as
|
|
17
|
-
export { default as
|
|
16
|
+
export { default as ChoiceChip } from './components/DataDisplay/Chips/ChoiceChip.js';
|
|
17
|
+
export { default as TagChip } from './components/DataDisplay/Chips/TagChip.js';
|
|
18
|
+
export { default as StatusChip } from './components/DataDisplay/Chips/StatusChip.js';
|
|
18
19
|
export { default as Toast } from './components/Feedback/Toast/Toast.js';
|
|
19
20
|
export { ToastProvider, clearToasts, dismissToast, showToast, useToast } from './components/Feedback/Toast/ToastProvider.js';
|
|
20
21
|
export { default as Input } from './components/Forms/primitive/Input/Input.js';
|
package/package.json
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import ChoiceChip from './ChoiceChip';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof ChoiceChip> = {
|
|
6
|
+
title: 'DataDisplay/Chips/ChoiceChip',
|
|
7
|
+
component: ChoiceChip,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
args: {
|
|
10
|
+
label: 'Actor/Actriz',
|
|
11
|
+
selected: false,
|
|
12
|
+
},
|
|
13
|
+
render: (args) => {
|
|
14
|
+
const [selected, setSelected] = useState(Boolean(args.selected));
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<div className="p-4">
|
|
18
|
+
<ChoiceChip {...args} selected={selected} onClick={() => setSelected((prev) => !prev)} />
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default meta;
|
|
25
|
+
type Story = StoryObj<typeof meta>;
|
|
26
|
+
|
|
27
|
+
export const Default: Story = {};
|
|
28
|
+
|
|
29
|
+
export const Selected: Story = {
|
|
30
|
+
args: {
|
|
31
|
+
selected: true,
|
|
32
|
+
},
|
|
33
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { clsx } from 'clsx';
|
|
2
|
+
import type { ButtonHTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
export type ChoiceChipProps = {
|
|
5
|
+
label: string;
|
|
6
|
+
selected?: boolean;
|
|
7
|
+
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'>;
|
|
8
|
+
|
|
9
|
+
export default function ChoiceChip({ label, selected = false, className, type = 'button', ...rest }: ChoiceChipProps) {
|
|
10
|
+
return (
|
|
11
|
+
<button
|
|
12
|
+
type={type}
|
|
13
|
+
className={clsx(
|
|
14
|
+
'px-4 py-1 rounded-full whitespace-nowrap cursor-pointer bg-transparent border-1',
|
|
15
|
+
selected
|
|
16
|
+
? 'text-(--color-primary-purple) border-(--color-primary-purple)'
|
|
17
|
+
: 'text-(--color-secondary-grey-fonts) border-(--color-secondary-outline)',
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
aria-pressed={selected}
|
|
21
|
+
{...rest}
|
|
22
|
+
>
|
|
23
|
+
{label}
|
|
24
|
+
</button>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
|
2
2
|
import StatusChip from './StatusChip';
|
|
3
3
|
|
|
4
4
|
const meta: Meta<typeof StatusChip> = {
|
|
5
|
-
title: '
|
|
5
|
+
title: 'DataDisplay/Chips/StatusChip',
|
|
6
6
|
component: StatusChip,
|
|
7
7
|
tags: ['autodocs'],
|
|
8
8
|
args: {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import TagChip from './TagChip';
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof TagChip> = {
|
|
5
|
+
title: 'DataDisplay/Chips/TagChip',
|
|
6
|
+
component: TagChip,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
args: {
|
|
9
|
+
label: 'Actor',
|
|
10
|
+
newItem: false,
|
|
11
|
+
},
|
|
12
|
+
render: (args) => (
|
|
13
|
+
<div className="p-4">
|
|
14
|
+
<TagChip {...args} />
|
|
15
|
+
</div>
|
|
16
|
+
),
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default meta;
|
|
20
|
+
type Story = StoryObj<typeof meta>;
|
|
21
|
+
|
|
22
|
+
export const Default: Story = {};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Icon } from '
|
|
1
|
+
import { Icon } from '../../Brand/Identity/Icon';
|
|
2
2
|
|
|
3
|
-
type
|
|
3
|
+
export type TagChipProps = {
|
|
4
4
|
label: string;
|
|
5
5
|
onRemove?: () => void;
|
|
6
6
|
newItem?: boolean;
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
export default function
|
|
9
|
+
export default function TagChip({ label, onRemove, newItem = false }: TagChipProps) {
|
|
10
10
|
return (
|
|
11
11
|
<span
|
|
12
12
|
className={[
|
|
13
|
-
'flex items-center gap-[6px] rounded-xl border px-3 py-1 lg:text-[14px]',
|
|
13
|
+
'inline-flex items-center gap-[6px] rounded-xl border px-3 py-1 lg:text-[14px]',
|
|
14
14
|
newItem
|
|
15
15
|
? 'font-semibold bg-(--color-secondary-white) border-(--color-primary-purple) text-(--color-primary-purple)'
|
|
16
16
|
: 'bg-(--color-primary-white) border-(--color-secondary-outline) text-(--color-primary-black)',
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import ChoiceChip from './ChoiceChip';
|
|
2
|
+
import TagChip from './TagChip';
|
|
3
|
+
import StatusChip from './StatusChip';
|
|
4
|
+
|
|
5
|
+
export { ChoiceChip, TagChip, StatusChip };
|
|
6
|
+
export type { ChoiceChipProps } from './ChoiceChip';
|
|
7
|
+
export type { TagChipProps } from './TagChip';
|
|
8
|
+
export type { StatusChipProps } from './StatusChip';
|
package/src/index.ts
CHANGED
|
@@ -9,7 +9,7 @@ export * from './components/Actions/Menus/TextDropdownTrigger';
|
|
|
9
9
|
export * from './components/Brand/Identity/Icon';
|
|
10
10
|
export * from './components/Brand/Identity/Logo';
|
|
11
11
|
export * from './components/Feedback/Loading/Spinner';
|
|
12
|
-
export * from './components/
|
|
12
|
+
export * from './components/DataDisplay/Chips';
|
|
13
13
|
export * from './components/Feedback/Toast';
|
|
14
14
|
export * from './components/Forms';
|
|
15
15
|
export * from './components/Media/Images/ImageCarousel';
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import Chip from './Chip';
|
|
3
|
-
|
|
4
|
-
const meta: Meta<typeof Chip> = {
|
|
5
|
-
title: 'Feedback/Status/Chip',
|
|
6
|
-
component: Chip,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
args: {
|
|
9
|
-
label: 'Talent',
|
|
10
|
-
onRemove: () => undefined,
|
|
11
|
-
},
|
|
12
|
-
render: (args) => (
|
|
13
|
-
<div className="flex min-h-[120px] items-center justify-center">
|
|
14
|
-
<Chip {...args} />
|
|
15
|
-
</div>
|
|
16
|
-
),
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export default meta;
|
|
20
|
-
type Story = StoryObj<typeof meta>;
|
|
21
|
-
|
|
22
|
-
export const Default: Story = {};
|
|
23
|
-
|
|
24
|
-
export const NewItem: Story = {
|
|
25
|
-
args: {
|
|
26
|
-
newItem: true,
|
|
27
|
-
},
|
|
28
|
-
};
|
|
File without changes
|