@tpc-mare/mare-ui-components-react 0.0.1
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/.storybook/main.d.ts +3 -0
- package/dist/.storybook/manager.d.ts +1 -0
- package/dist/.storybook/preview.d.ts +3 -0
- package/dist/avatar/Avatar.d.ts +2 -0
- package/dist/avatar/Avatar.types.d.ts +26 -0
- package/dist/avatar/index.d.ts +2 -0
- package/dist/avatar/index.js +4 -0
- package/dist/badge/Badge.d.ts +2 -0
- package/dist/badge/Badge.types.d.ts +11 -0
- package/dist/badge/index.d.ts +2 -0
- package/dist/badge/index.js +4 -0
- package/dist/button/Button.d.ts +2 -0
- package/dist/button/Button.types.d.ts +18 -0
- package/dist/button/index.d.ts +2 -0
- package/dist/button/index.js +4 -0
- package/dist/checkbox/Checkbox.d.ts +2 -0
- package/dist/checkbox/Checkbox.types.d.ts +69 -0
- package/dist/checkbox/index.d.ts +2 -0
- package/dist/checkbox/index.js +4 -0
- package/dist/combobox/Combobox.d.ts +13 -0
- package/dist/combobox/Combobox.types.d.ts +16 -0
- package/dist/combobox/index.d.ts +2 -0
- package/dist/combobox/index.js +4 -0
- package/dist/date-picker/DatePicker.d.ts +3 -0
- package/dist/date-picker/DatePicker.types.d.ts +52 -0
- package/dist/date-picker/index.d.ts +2 -0
- package/dist/date-picker/index.js +4 -0
- package/dist/dialog/Dialog.d.ts +2 -0
- package/dist/dialog/Dialog.types.d.ts +55 -0
- package/dist/dialog/DialogFooter.d.ts +2 -0
- package/dist/dialog/DialogHeader.d.ts +2 -0
- package/dist/dialog/index.d.ts +4 -0
- package/dist/dialog/index.js +6 -0
- package/dist/drawer/Drawer.d.ts +2 -0
- package/dist/drawer/Drawer.types.d.ts +53 -0
- package/dist/drawer/DrawerFooter.d.ts +2 -0
- package/dist/drawer/DrawerHeader.d.ts +2 -0
- package/dist/drawer/index.d.ts +4 -0
- package/dist/drawer/index.js +6 -0
- package/dist/index/index.d.ts +44 -0
- package/dist/index/index.js +57 -0
- package/dist/input-number/InputNumber.d.ts +2 -0
- package/dist/input-number/InputNumber.types.d.ts +30 -0
- package/dist/input-number/index.d.ts +2 -0
- package/dist/input-number/index.js +4 -0
- package/dist/input-text/CharacterCount.d.ts +5 -0
- package/dist/input-text/FloatLabel.d.ts +6 -0
- package/dist/input-text/FormField.d.ts +8 -0
- package/dist/input-text/HelperText.d.ts +4 -0
- package/dist/input-text/IconField.d.ts +16 -0
- package/dist/input-text/InputText.d.ts +2 -0
- package/dist/input-text/InputText.types.d.ts +14 -0
- package/dist/input-text/field-layout.d.ts +12 -0
- package/dist/input-text/index.d.ts +11 -0
- package/dist/input-text/index.js +10 -0
- package/dist/menu/Menu.d.ts +2 -0
- package/dist/menu/Menu.types.d.ts +19 -0
- package/dist/menu/index.d.ts +2 -0
- package/dist/menu/index.js +4 -0
- package/dist/panel-menu/PanelMenu.d.ts +2 -0
- package/dist/panel-menu/PanelMenu.types.d.ts +12 -0
- package/dist/panel-menu/index.d.ts +2 -0
- package/dist/panel-menu/index.js +4 -0
- package/dist/progress-spinner/ProgressSpinner.d.ts +10 -0
- package/dist/progress-spinner/index.d.ts +2 -0
- package/dist/progress-spinner/index.js +4 -0
- package/dist/radio-group/RadioGroup.d.ts +2 -0
- package/dist/radio-group/RadioGroup.types.d.ts +62 -0
- package/dist/radio-group/index.d.ts +2 -0
- package/dist/radio-group/index.js +4 -0
- package/dist/search-field/SearchField.d.ts +2 -0
- package/dist/search-field/SearchField.types.d.ts +26 -0
- package/dist/search-field/index.d.ts +2 -0
- package/dist/search-field/index.js +4 -0
- package/dist/select-field/SelectField.d.ts +14 -0
- package/dist/select-field/SelectField.types.d.ts +11 -0
- package/dist/select-field/index.d.ts +2 -0
- package/dist/select-field/index.js +4 -0
- package/dist/shared/Avatar-D3QlO3Tz.js +59 -0
- package/dist/shared/Badge-WC6my4Aw.js +35 -0
- package/dist/shared/Button-AfMqNCme.js +177 -0
- package/dist/shared/Checkbox-Ci1b59K1.js +134 -0
- package/dist/shared/Combobox-DZ5SgSv6.js +134 -0
- package/dist/shared/DatePicker-BMl0szfL.js +856 -0
- package/dist/shared/DialogFooter-Bg3hz6fh.js +154 -0
- package/dist/shared/DrawerFooter-COA137vD.js +172 -0
- package/dist/shared/HelperText-CVWWvLCI.js +46 -0
- package/dist/shared/IconField-Dh6j6SL1.js +78 -0
- package/dist/shared/InputNumber-D48wsE-o.js +62 -0
- package/dist/shared/Menu-Cv9dU1iA.js +104 -0
- package/dist/shared/PanelMenu-5A9LgcGR.js +123 -0
- package/dist/shared/ProgressSpinner-B-lrS-tu.js +35 -0
- package/dist/shared/RadioGroup-lw27DCoV.js +133 -0
- package/dist/shared/SearchField-CuQ0cXOZ.js +63 -0
- package/dist/shared/SelectField-D6OlgFYy.js +118 -0
- package/dist/shared/Snackbar-C29nLHO9.js +100 -0
- package/dist/shared/Stepper-BGKHXl-b.js +110 -0
- package/dist/shared/Switch-D6E2OmgE.js +104 -0
- package/dist/shared/Tabs-BqIorZYD.js +66 -0
- package/dist/shared/Tag-BtbmgIwL.js +36 -0
- package/dist/shared/Textarea-iJhYTZos.js +40 -0
- package/dist/shared/field-layout-D34MpDMB.js +53 -0
- package/dist/shared/icons-_QeAcImG.js +44 -0
- package/dist/shared/icons.d.ts +11 -0
- package/dist/shared/useMediaQuery.d.ts +5 -0
- package/dist/snackbar/Snackbar.d.ts +3 -0
- package/dist/snackbar/Snackbar.types.d.ts +42 -0
- package/dist/snackbar/index.d.ts +2 -0
- package/dist/snackbar/index.js +5 -0
- package/dist/stepper/Stepper.d.ts +2 -0
- package/dist/stepper/Stepper.types.d.ts +18 -0
- package/dist/stepper/index.d.ts +2 -0
- package/dist/stepper/index.js +4 -0
- package/dist/styles.css +1 -0
- package/dist/switch/Switch.d.ts +2 -0
- package/dist/switch/Switch.types.d.ts +59 -0
- package/dist/switch/index.d.ts +2 -0
- package/dist/switch/index.js +4 -0
- package/dist/tabs/Tabs.d.ts +10 -0
- package/dist/tabs/Tabs.types.d.ts +7 -0
- package/dist/tabs/index.d.ts +2 -0
- package/dist/tabs/index.js +4 -0
- package/dist/tag/Tag.d.ts +2 -0
- package/dist/tag/Tag.types.d.ts +11 -0
- package/dist/tag/index.d.ts +2 -0
- package/dist/tag/index.js +4 -0
- package/dist/textarea/Textarea.d.ts +2 -0
- package/dist/textarea/Textarea.types.d.ts +15 -0
- package/dist/textarea/index.d.ts +2 -0
- package/dist/textarea/index.js +4 -0
- package/dist/themes/baglioni-resorts.css +1 -0
- package/dist/themes/baglioni.css +1 -0
- package/dist/themes/le-blanc.css +1 -0
- package/dist/themes/palace.css +1 -0
- package/dist/themes/the-palace-company.css +1 -0
- package/dist/vite.config.d.ts +2 -0
- package/package.json +70 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface FormFieldProperties {
|
|
3
|
+
invalid?: boolean;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
required?: boolean;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare function FormField({ invalid, disabled, required, children, }: FormFieldProperties): import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface IconFieldProperties {
|
|
3
|
+
icon: ReactNode;
|
|
4
|
+
position?: 'left' | 'right';
|
|
5
|
+
/** Dims the icon to match a disabled sibling input. IconField can't see
|
|
6
|
+
* that prop on its own (it lives on the input, not on IconField) — pass
|
|
7
|
+
* it through explicitly when composing (see SearchField). @default false */
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
/** Makes the icon a real click target (a `<button>`, not a decorative
|
|
10
|
+
* `<span>`). @default undefined (decorative) */
|
|
11
|
+
onIconClick?: () => void;
|
|
12
|
+
/** Accessible name for the button, when `onIconClick` is set. */
|
|
13
|
+
iconLabel?: string;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export declare function IconField({ icon, position, disabled, onIconClick, iconLabel, children, }: IconFieldProperties): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
import { InputTextSize } from '@tpc-development/mare-ui-components-core/input-text';
|
|
3
|
+
export type { InputTextSize } from '@tpc-development/mare-ui-components-core/input-text';
|
|
4
|
+
type ForwardedNativeProperties = Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'size' | 'className' | 'style'>;
|
|
5
|
+
export interface InputTextProperties extends ForwardedNativeProperties {
|
|
6
|
+
/** Controlled value. */
|
|
7
|
+
value?: string;
|
|
8
|
+
/** Controlled change handler — receives the next string value. */
|
|
9
|
+
onValueChange?: (value: string) => void;
|
|
10
|
+
size?: InputTextSize;
|
|
11
|
+
rounded?: boolean;
|
|
12
|
+
invalid?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface FieldLayout {
|
|
2
|
+
hasFloatLabel: boolean;
|
|
3
|
+
iconSide: 'left' | 'right' | 'both' | null;
|
|
4
|
+
}
|
|
5
|
+
export declare const FieldLayoutContext: import('react').Context<FieldLayout | null>;
|
|
6
|
+
export declare const useFieldLayout: () => FieldLayout | null;
|
|
7
|
+
/** Combines a parent IconField's side (if any) with this one's — nesting two
|
|
8
|
+
* IconFields (one 'left', one 'right') around the same input, e.g.
|
|
9
|
+
* SearchField's search + clear icons, needs both padded, not just the
|
|
10
|
+
* nearest one. Two IconFields on the SAME side is a consumer error; last one
|
|
11
|
+
* wins rather than throwing. */
|
|
12
|
+
export declare const mergeIconSide: (parentSide: FieldLayout["iconSide"], ownSide: "left" | "right") => FieldLayout["iconSide"];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { InputText } from './InputText';
|
|
2
|
+
export { CharacterCount } from './CharacterCount';
|
|
3
|
+
export { FormField } from './FormField';
|
|
4
|
+
export { FloatLabel } from './FloatLabel';
|
|
5
|
+
export { IconField } from './IconField';
|
|
6
|
+
export { HelperText } from './HelperText';
|
|
7
|
+
export type { InputTextProperties, InputTextSize } from './InputText.types';
|
|
8
|
+
export type { CharacterCountProperties } from './CharacterCount';
|
|
9
|
+
export type { FormFieldProperties } from './FormField';
|
|
10
|
+
export type { FloatLabelProperties } from './FloatLabel';
|
|
11
|
+
export type { IconFieldProperties } from './IconField';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { I as o, a as r } from "../shared/IconField-Dh6j6SL1.js";
|
|
2
|
+
import { C as s, F as l, a as F, H as p } from "../shared/HelperText-CVWWvLCI.js";
|
|
3
|
+
export {
|
|
4
|
+
s as CharacterCount,
|
|
5
|
+
l as FloatLabel,
|
|
6
|
+
F as FormField,
|
|
7
|
+
p as HelperText,
|
|
8
|
+
o as IconField,
|
|
9
|
+
r as InputText
|
|
10
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode, RefObject } from 'react';
|
|
2
|
+
import { MenuEntry, MenuItemData } from '@tpc-development/mare-ui-components-core/menu';
|
|
3
|
+
export type { MenuItemData, MenuSeparatorEntry, MenuGroupEntry, MenuEntry, } from '@tpc-development/mare-ui-components-core/menu';
|
|
4
|
+
export interface MenuProperties {
|
|
5
|
+
/** The element that opens the menu on click — typically a `<Button>`. */
|
|
6
|
+
trigger: ReactNode;
|
|
7
|
+
items: MenuEntry[];
|
|
8
|
+
/** Called with the selected item's `value` when an item (or an item
|
|
9
|
+
* inside a group) is chosen. */
|
|
10
|
+
onSelect?: (value: string) => void;
|
|
11
|
+
/** Custom render for an item's content (icon + label). Defaults to
|
|
12
|
+
* `item.icon` (if any) + `item.label`. */
|
|
13
|
+
renderItem?: (item: MenuItemData) => ReactNode;
|
|
14
|
+
/** Where the menu portals to. Ark defaults to `document.body` — override
|
|
15
|
+
* this if your app scopes `data-theme` (or any other CSS custom property)
|
|
16
|
+
* to a sub-tree rather than the document root, otherwise the portaled
|
|
17
|
+
* menu renders outside that scope and loses the tokens. */
|
|
18
|
+
portalContainer?: RefObject<HTMLElement | null>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { PanelMenuItemData } from '@tpc-development/mare-ui-components-core/panel-menu';
|
|
3
|
+
export type { PanelMenuItemData } from '@tpc-development/mare-ui-components-core/panel-menu';
|
|
4
|
+
export interface PanelMenuProperties {
|
|
5
|
+
items: PanelMenuItemData[];
|
|
6
|
+
/** Controlled expanded branch values. Omit to let Ark manage it (uncontrolled). */
|
|
7
|
+
expandedValue?: string[];
|
|
8
|
+
defaultExpandedValue?: string[];
|
|
9
|
+
onExpandedChange?: (value: string[]) => void;
|
|
10
|
+
/** Override the default icon + label row entirely. */
|
|
11
|
+
renderItem?: (item: PanelMenuItemData) => ReactNode;
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mare ProgressSpinner — React. Ark has no spinner (pure SVG + CSS), so it's
|
|
3
|
+
* Mare-owned. Identical markup to the Vue version. Dash keyframe in styles.css.
|
|
4
|
+
*/
|
|
5
|
+
export interface ProgressSpinnerProperties {
|
|
6
|
+
/** Extra classes for the <circle> (e.g. stroke color per Button severity). */
|
|
7
|
+
circleClass?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function ProgressSpinner({ circleClass, className, }: ProgressSpinnerProperties): import("react").JSX.Element;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { RadioGroupSize, RadioGroupOrientation, RadioOptionItem } from '@tpc-development/mare-ui-components-core/radio-group';
|
|
2
|
+
export type { RadioGroupSize, RadioGroupOrientation, RadioOptionItem, } from '@tpc-development/mare-ui-components-core/radio-group';
|
|
3
|
+
export interface RadioGroupProperties {
|
|
4
|
+
/**
|
|
5
|
+
* The available options.
|
|
6
|
+
*/
|
|
7
|
+
items: RadioOptionItem[];
|
|
8
|
+
/**
|
|
9
|
+
* The controlled selected value.
|
|
10
|
+
*/
|
|
11
|
+
value?: string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Initial selected value (uncontrolled mode).
|
|
14
|
+
*/
|
|
15
|
+
defaultValue?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Handler called when the selected value changes.
|
|
18
|
+
*/
|
|
19
|
+
onValueChange?: (value: string) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Size variant.
|
|
22
|
+
* @default 'small'
|
|
23
|
+
*/
|
|
24
|
+
size?: RadioGroupSize;
|
|
25
|
+
/**
|
|
26
|
+
* Layout direction of the items.
|
|
27
|
+
* @default 'vertical'
|
|
28
|
+
*/
|
|
29
|
+
orientation?: RadioGroupOrientation;
|
|
30
|
+
/**
|
|
31
|
+
* Disables the entire group.
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Marks the group as invalid (red styling).
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
invalid?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Makes the group read-only.
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
readOnly?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Marks the group as required for form validation.
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
49
|
+
required?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* The name attribute for form submission.
|
|
52
|
+
*/
|
|
53
|
+
name?: string;
|
|
54
|
+
/**
|
|
55
|
+
* ID of an associated form element.
|
|
56
|
+
*/
|
|
57
|
+
form?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Unique identifier for the group.
|
|
60
|
+
*/
|
|
61
|
+
id?: string;
|
|
62
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { InputTextProperties } from '../InputText';
|
|
3
|
+
/** Native passthrough same as InputText, minus what SearchField owns/reshapes. */
|
|
4
|
+
type ForwardedInputProperties = Omit<InputTextProperties, 'value' | 'onValueChange' | 'rounded'>;
|
|
5
|
+
export interface SearchFieldProperties extends ForwardedInputProperties {
|
|
6
|
+
/** Controlled value. */
|
|
7
|
+
value?: string;
|
|
8
|
+
/** Controlled change handler — receives the next string value. */
|
|
9
|
+
onValueChange?: (value: string) => void;
|
|
10
|
+
/** Shows a spinner instead of the clear icon. @default false */
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
/** Shows a clear (X) button when there's a value. @default false */
|
|
13
|
+
clearable?: boolean;
|
|
14
|
+
/** Overrides the left icon. @default a search icon */
|
|
15
|
+
leftIcon?: ReactNode;
|
|
16
|
+
/** Overrides the clear button's icon. @default a close (X) icon */
|
|
17
|
+
clearIcon?: ReactNode;
|
|
18
|
+
/** Replaces the clear/spinner logic entirely with your own right-side
|
|
19
|
+
* content (matches the legacy: a custom right icon takes over from the
|
|
20
|
+
* built-in clear button). @default undefined */
|
|
21
|
+
rightIcon?: ReactNode;
|
|
22
|
+
/** Fires when the built-in clear button is clicked (clears `value` too).
|
|
23
|
+
* Does NOT fire for a custom `rightIcon` — wire that yourself. */
|
|
24
|
+
onClear?: () => void;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { SelectFieldProperties, SelectOptionItem } from './SelectField.types';
|
|
3
|
+
interface SelectFieldReactProperties extends SelectFieldProperties {
|
|
4
|
+
value?: string | null;
|
|
5
|
+
onValueChange?: (value: string | null) => void;
|
|
6
|
+
leadingIcon?: ReactNode;
|
|
7
|
+
indicator?: ReactNode;
|
|
8
|
+
clearIcon?: ReactNode;
|
|
9
|
+
checkIcon?: ReactNode;
|
|
10
|
+
renderValue?: (item: SelectOptionItem) => ReactNode;
|
|
11
|
+
renderOption?: (option: SelectOptionItem) => ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare function SelectField({ value, onValueChange, options, placeholder, size, disabled, invalid, clearable, label, leadingIcon, indicator, clearIcon, checkIcon, renderValue, renderOption, }: SelectFieldReactProperties): import("react").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SelectFieldSize, SelectOptionItem } from '@tpc-development/mare-ui-components-core/select-field';
|
|
2
|
+
export type { SelectFieldSize, SelectOptionItem, } from '@tpc-development/mare-ui-components-core/select-field';
|
|
3
|
+
export interface SelectFieldProperties {
|
|
4
|
+
options: SelectOptionItem[];
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
size?: SelectFieldSize;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
invalid?: boolean;
|
|
9
|
+
clearable?: boolean;
|
|
10
|
+
label?: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsxs as o, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { Avatar as m } from "@ark-ui/react/avatar";
|
|
3
|
+
const s = (a) => a.normalize("NFD").replaceAll(/[̀-ͯ]/g, ""), d = (a) => {
|
|
4
|
+
if (!a) return "";
|
|
5
|
+
const e = a.trim().split(/\s+/).filter(Boolean);
|
|
6
|
+
if (e.length === 1)
|
|
7
|
+
return s(e[0].slice(0, 2)).toUpperCase();
|
|
8
|
+
const t = s(e[0][0]), r = s(e.at(-1)?.[0] ?? "");
|
|
9
|
+
return (t + r).toUpperCase();
|
|
10
|
+
}, n = `
|
|
11
|
+
mare:inline-flex mare:items-center mare:justify-center
|
|
12
|
+
mare:rounded-full mare:bg-accent-weak mare:text-accent
|
|
13
|
+
|
|
14
|
+
mare:data-size-small:h-8 mare:data-size-small:w-8 mare:data-size-small:text-base
|
|
15
|
+
mare:data-size-medium:h-10 mare:data-size-medium:w-10 mare:data-size-medium:text-base
|
|
16
|
+
`, c = `
|
|
17
|
+
mare:h-full mare:w-full mare:rounded-full mare:object-cover
|
|
18
|
+
`, u = `
|
|
19
|
+
mare:rounded-full
|
|
20
|
+
mare:data-size-small:tpc-typography-body-s
|
|
21
|
+
mare:data-size-medium:tpc-typography-body-m
|
|
22
|
+
`;
|
|
23
|
+
function z({
|
|
24
|
+
image: a,
|
|
25
|
+
alt: e = "",
|
|
26
|
+
label: t = "",
|
|
27
|
+
size: r = "small",
|
|
28
|
+
id: i
|
|
29
|
+
}) {
|
|
30
|
+
return /* @__PURE__ */ o(
|
|
31
|
+
m.Root,
|
|
32
|
+
{
|
|
33
|
+
id: i,
|
|
34
|
+
className: n,
|
|
35
|
+
"data-size": r,
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ l(
|
|
38
|
+
m.Fallback,
|
|
39
|
+
{
|
|
40
|
+
className: u,
|
|
41
|
+
"data-size": r,
|
|
42
|
+
children: d(t)
|
|
43
|
+
}
|
|
44
|
+
),
|
|
45
|
+
a && /* @__PURE__ */ l(
|
|
46
|
+
m.Image,
|
|
47
|
+
{
|
|
48
|
+
className: c,
|
|
49
|
+
src: a,
|
|
50
|
+
alt: e
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
z as A
|
|
59
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
const s = `
|
|
3
|
+
mare:rounded-full mare:inline-flex mare:justify-center mare:items-center
|
|
4
|
+
mare:text-center mare:py-0 mare:tpc-typography-label-xs
|
|
5
|
+
mare:h-2 mare:min-w-2 mare:has-value:h-4 mare:has-value:min-w-4
|
|
6
|
+
mare:has-icon:px-0 mare:px-1
|
|
7
|
+
mare:data-severity-accent:bg-accent mare:data-severity-accent:text-on-accent
|
|
8
|
+
mare:data-severity-danger:bg-danger mare:data-severity-danger:text-on-danger
|
|
9
|
+
mare:data-severity-warning:bg-warning mare:data-severity-warning:text-on-warning
|
|
10
|
+
mare:data-severity-highlight:bg-highlight mare:data-severity-highlight:text-on-accent
|
|
11
|
+
mare:data-severity-positive:bg-positive mare:data-severity-positive:text-on-positive
|
|
12
|
+
`;
|
|
13
|
+
function c({
|
|
14
|
+
severity: r = "accent",
|
|
15
|
+
icon: e,
|
|
16
|
+
children: a
|
|
17
|
+
}) {
|
|
18
|
+
const t = !!e, n = t || a != null;
|
|
19
|
+
return /* @__PURE__ */ i(
|
|
20
|
+
"span",
|
|
21
|
+
{
|
|
22
|
+
className: s,
|
|
23
|
+
"data-severity": r,
|
|
24
|
+
"data-has-value": n ? "true" : void 0,
|
|
25
|
+
"data-has-icon": t ? "true" : void 0,
|
|
26
|
+
children: [
|
|
27
|
+
e,
|
|
28
|
+
a
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
c as B
|
|
35
|
+
};
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { jsxs as f, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { P as z } from "./ProgressSpinner-B-lrS-tu.js";
|
|
3
|
+
const x = {
|
|
4
|
+
left: "mare:-order-1",
|
|
5
|
+
right: "mare:order-1",
|
|
6
|
+
top: "mare:-order-1",
|
|
7
|
+
bottom: "mare:order-1"
|
|
8
|
+
}, k = {
|
|
9
|
+
primary: "mare:stroke-on-accent",
|
|
10
|
+
secondary: "mare:stroke-default",
|
|
11
|
+
ghost: "mare:stroke-default",
|
|
12
|
+
danger: "mare:stroke-on-danger",
|
|
13
|
+
neutral: "mare:stroke-default"
|
|
14
|
+
}, w = (e) => e === "bordered" ? `mare:data-severity-neutral:border mare:data-severity-neutral:border-strong
|
|
15
|
+
mare:data-severity-ghost:border mare:data-severity-ghost:border-strong mare:not-p-disabled:data-severity-ghost:hover:bg-transparent` : `
|
|
16
|
+
mare:not-p-disabled:not-data-link:[&[data-severity~='ghost']:active]:bg-active
|
|
17
|
+
mare:not-p-disabled:not-data-link:[&[data-severity~='danger']:active]:bg-danger-active`, $ = (e, a) => `
|
|
18
|
+
mare:group/button
|
|
19
|
+
mare:relative
|
|
20
|
+
mare:rounded-button mare:flex mare:items-center mare:justify-center
|
|
21
|
+
mare:cursor-pointer mare-p-button
|
|
22
|
+
mare:active:duration-150 mare:transition-[cubic-bezier(0.2,0,0,1)]
|
|
23
|
+
|
|
24
|
+
mare:data-severity-primary:bg-accent mare:data-severity-primary:text-on-accent mare:data-severity-primary:stroke-on-accent!
|
|
25
|
+
mare:data-severity-primary:border mare:data-severity-primary:border-transparent mare:not-p-disabled:data-severity-primary:hover:bg-accent-hover
|
|
26
|
+
mare:data-severity-secondary:bg-transparent mare:data-severity-secondary:text-default
|
|
27
|
+
mare:data-severity-secondary:border mare:data-severity-secondary:border-strong mare:not-p-disabled:data-severity-secondary:hover:bg-hover
|
|
28
|
+
mare:data-severity-secondary:not-data-link:active:bg-active!
|
|
29
|
+
mare:data-severity-ghost:bg-transparent mare:not-p-disabled:data-severity-ghost:hover:bg-hover
|
|
30
|
+
mare:data-severity-ghost:text-default
|
|
31
|
+
mare:data-severity-ghost:border mare:data-severity-ghost:border-transparent
|
|
32
|
+
mare:not-p-disabled:data-severity-ghost:not-data-link:active:bg-active
|
|
33
|
+
mare:data-severity-danger:bg-danger
|
|
34
|
+
mare:data-severity-danger:border mare:data-severity-danger:border-transparent
|
|
35
|
+
mare:data-severity-danger:text-on-accent
|
|
36
|
+
mare:not-p-disabled:data-severity-danger:hover:bg-danger-hover
|
|
37
|
+
|
|
38
|
+
mare:not-p-disabled:not-data-link:[&[data-severity~='primary']:active]:bg-accent-active
|
|
39
|
+
mare:not-p-disabled:not-data-link:[&[data-severity~='secondary']:active]:bg-active
|
|
40
|
+
mare:not-p-disabled:not-data-link:[&[data-severity~='danger']:active]:bg-danger-active
|
|
41
|
+
|
|
42
|
+
mare:data-severity-neutral:bg-default mare:data-severity-neutral:text-default
|
|
43
|
+
${w(e)}
|
|
44
|
+
mare:data-size-small:py-2.5 mare:data-size-small:px-3.5 mare:data-size-small:gap-1
|
|
45
|
+
mare:data-size-small:icon-only:rounded:p-2.5 mare:data-size-small:h-10 mare:data-size-small:icon-only:w-10 mare:data-size-small:icon-only:min-w-10
|
|
46
|
+
|
|
47
|
+
mare:data-size-xsmall:py-1.5 mare:data-size-xsmall:px-3 mare:data-size-xsmall:gap-1
|
|
48
|
+
mare:data-size-xsmall:icon-only:rounded:p-2.5 mare:data-size-xsmall:h-8 mare:data-size-xsmall:icon-only:w-8 mare:data-size-xsmall:icon-only:min-w-8
|
|
49
|
+
|
|
50
|
+
mare:data-size-medium:py-2.5 mare:data-size-medium:px-5.5
|
|
51
|
+
mare:data-size-medium:gap-1.5
|
|
52
|
+
mare:data-size-medium:icon-only:rounded:p-3.5 mare:data-size-medium:h-12 mare:data-size-medium:icon-only:w-12 mare:data-size-medium:icon-only:min-w-12
|
|
53
|
+
|
|
54
|
+
mare:data-size-large:py-4 mare:data-size-large:px-5.5
|
|
55
|
+
mare:data-size-large:gap-1.5
|
|
56
|
+
mare:data-size-large:icon-only:rounded:p-1.5 mare:data-size-large:h-14 mare:data-size-large:icon-only:w-14 mare:data-size-large:icon-only:min-w-14
|
|
57
|
+
|
|
58
|
+
mare:p-active:scale-95
|
|
59
|
+
mare:p-active:shadow-[0_2px_8px_0_rgba(0,0,0,0.16)]
|
|
60
|
+
mare:p-disabled:cursor-not-allowed
|
|
61
|
+
mare:not-p-loading:p-disabled:text-disabled
|
|
62
|
+
mare:not-p-loading:p-disabled:data-severity-primary:bg-disabled
|
|
63
|
+
mare:not-p-loading:p-disabled:data-severity-danger:bg-disabled
|
|
64
|
+
mare:not-p-loading:p-disabled:data-severity-secondary:border
|
|
65
|
+
mare:not-p-loading:p-disabled:data-severity-secondary:border-disabled-default
|
|
66
|
+
mare:p-loading:cursor-wait
|
|
67
|
+
mare:icon-only:rounded-full!
|
|
68
|
+
mare:rounded:rounded-full
|
|
69
|
+
mare:p-raised:shadow-[0_4px_16px_0_rgba(0,0,0,0.16)]
|
|
70
|
+
|
|
71
|
+
mare:data-link:bg-transparent
|
|
72
|
+
mare:data-link:border-0
|
|
73
|
+
mare:data-link:text-default
|
|
74
|
+
mare:data-link:hover:bg-transparent!
|
|
75
|
+
mare:data-link:hover:text-default
|
|
76
|
+
mare:data-link:p-0!
|
|
77
|
+
mare:data-link:p-disabled:border-none!
|
|
78
|
+
mare:data-link:h-auto
|
|
79
|
+
mare:p-disabled:data-link:bg-transparent!
|
|
80
|
+
|
|
81
|
+
${a ? "mare-p-link" : ""}
|
|
82
|
+
|
|
83
|
+
mare:data-link:data-size-xsmall:h-auto
|
|
84
|
+
mare:data-link:data-size-xsmall:gap-1.5
|
|
85
|
+
|
|
86
|
+
mare:data-link:data-size-small:h-auto
|
|
87
|
+
mare:data-link:data-size-small:gap-1.5
|
|
88
|
+
|
|
89
|
+
mare:data-link:data-size-medium:h-auto
|
|
90
|
+
mare:data-link:data-size-medium:gap-2
|
|
91
|
+
|
|
92
|
+
mare:data-link:data-size-large:h-auto
|
|
93
|
+
mare:data-link:data-size-large:gap-2
|
|
94
|
+
`, _ = "mare:relative mare:inline-block mare:no-underline! mare:after:content-[''] mare:after:absolute mare:after:left-0 mare:after:-bottom-[4px] mare:after:h-[1px] mare:after:w-full mare:after:bg-inverse mare:after:origin-left mare:after:scale-x-[1] mare:after:transform-gpu mare:after:will-change-transform mare:after:transition-transform mare:after:duration-[500ms] mare:after:ease-[cubic-bezier(0.19,1,0.22,1)] mare:hover:after:scale-x-0 mare:hover:after:origin-right", L = (e) => {
|
|
95
|
+
const { isLink: a, animateLink: r, hiddenLabel: s, loading: d } = e;
|
|
96
|
+
return `mare:relative
|
|
97
|
+
${a ? "mare:data-size-xsmall:tpc-typography-label-s-underline" : "mare:data-size-xsmall:tpc-typography-label-s"}
|
|
98
|
+
${a ? "mare:data-size-small:tpc-typography-label-s-underline" : "mare:data-size-small:tpc-typography-label-s"}
|
|
99
|
+
${a ? "mare:data-size-medium:tpc-typography-label-m-underline" : "mare:data-size-medium:tpc-typography-label-m"}
|
|
100
|
+
${a ? "mare:data-size-large:tpc-typography-label-m-underline" : "mare:data-size-large:tpc-typography-label-m"}
|
|
101
|
+
${r && a ? _ : ""}
|
|
102
|
+
${s ? "mare:hidden" : ""} ${a ? "" : "mare:px-0.5"} ${d ? "mare:opacity-0" : ""}
|
|
103
|
+
`;
|
|
104
|
+
}, j = (e, a, r) => a ? e === "xsmall" || e === "small" ? "small" : "medium" : e === "xsmall" ? r ? "medium" : "small" : "medium", N = {
|
|
105
|
+
small: 16,
|
|
106
|
+
medium: 20
|
|
107
|
+
};
|
|
108
|
+
function S({
|
|
109
|
+
label: e,
|
|
110
|
+
severity: a = "primary",
|
|
111
|
+
size: r = "medium",
|
|
112
|
+
variant: s = "solid",
|
|
113
|
+
iconOnly: d = !1,
|
|
114
|
+
disabled: l = !1,
|
|
115
|
+
loading: t = !1,
|
|
116
|
+
link: c = !1,
|
|
117
|
+
linkAnimation: y = !1,
|
|
118
|
+
icon: n,
|
|
119
|
+
iconPos: g = "left",
|
|
120
|
+
children: o,
|
|
121
|
+
type: b = "button",
|
|
122
|
+
...u
|
|
123
|
+
}) {
|
|
124
|
+
const i = c, v = !!e || !!o, h = d && !!n, p = N[j(r, i, d)];
|
|
125
|
+
return /* @__PURE__ */ f(
|
|
126
|
+
"button",
|
|
127
|
+
{
|
|
128
|
+
type: b,
|
|
129
|
+
className: $(s, i),
|
|
130
|
+
"data-severity": a,
|
|
131
|
+
"data-size": r,
|
|
132
|
+
"data-icon-only": d ? "true" : void 0,
|
|
133
|
+
"data-disabled": l ? "true" : void 0,
|
|
134
|
+
"data-loading": t ? "true" : void 0,
|
|
135
|
+
"data-link": i ? "true" : void 0,
|
|
136
|
+
disabled: l || t,
|
|
137
|
+
"aria-busy": t || void 0,
|
|
138
|
+
...u,
|
|
139
|
+
children: [
|
|
140
|
+
t && /* @__PURE__ */ m("span", { className: "mare:absolute mare:inset-0 mare:flex mare:items-center mare:justify-center", children: /* @__PURE__ */ m(
|
|
141
|
+
z,
|
|
142
|
+
{
|
|
143
|
+
circleClass: k[a],
|
|
144
|
+
className: "mare:size-5"
|
|
145
|
+
}
|
|
146
|
+
) }),
|
|
147
|
+
n && /* @__PURE__ */ m(
|
|
148
|
+
"span",
|
|
149
|
+
{
|
|
150
|
+
className: `mare:inline-flex mare:shrink-0 mare:items-center mare:justify-center mare:[&>svg]:size-full! ${x[g]} ${t ? "mare:opacity-0" : ""}`,
|
|
151
|
+
style: {
|
|
152
|
+
width: `${p}px`,
|
|
153
|
+
height: `${p}px`
|
|
154
|
+
},
|
|
155
|
+
"aria-hidden": "true",
|
|
156
|
+
children: n
|
|
157
|
+
}
|
|
158
|
+
),
|
|
159
|
+
v && /* @__PURE__ */ m(
|
|
160
|
+
"span",
|
|
161
|
+
{
|
|
162
|
+
className: L({
|
|
163
|
+
isLink: i,
|
|
164
|
+
animateLink: y,
|
|
165
|
+
hiddenLabel: h,
|
|
166
|
+
loading: t
|
|
167
|
+
}),
|
|
168
|
+
children: o ?? e
|
|
169
|
+
}
|
|
170
|
+
)
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
export {
|
|
176
|
+
S as B
|
|
177
|
+
};
|