@tonyarbor/components 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Button.d.mts +1 -1
- package/dist/Button.d.ts +1 -1
- package/dist/Button.js +56 -0
- package/dist/Button.js.map +1 -1
- package/dist/Button.mjs +1 -1
- package/dist/Modal.d.mts +73 -0
- package/dist/Modal.d.ts +73 -0
- package/dist/Modal.js +114 -0
- package/dist/Modal.js.map +1 -0
- package/dist/Modal.mjs +9 -0
- package/dist/Modal.mjs.map +1 -0
- package/dist/ModalFooter.d.mts +40 -0
- package/dist/ModalFooter.d.ts +40 -0
- package/dist/ModalFooter.js +73 -0
- package/dist/ModalFooter.js.map +1 -0
- package/dist/ModalFooter.mjs +7 -0
- package/dist/ModalFooter.mjs.map +1 -0
- package/dist/ModalHeader.d.mts +65 -0
- package/dist/ModalHeader.d.ts +65 -0
- package/dist/ModalHeader.js +257 -0
- package/dist/ModalHeader.js.map +1 -0
- package/dist/ModalHeader.mjs +8 -0
- package/dist/ModalHeader.mjs.map +1 -0
- package/dist/chunk-7JWINM2N.mjs +77 -0
- package/dist/chunk-7JWINM2N.mjs.map +1 -0
- package/dist/chunk-GIQDPHZQ.mjs +121 -0
- package/dist/chunk-GIQDPHZQ.mjs.map +1 -0
- package/dist/{chunk-ALEJXAZY.mjs → chunk-NOUFR6W2.mjs} +57 -1
- package/dist/chunk-NOUFR6W2.mjs.map +1 -0
- package/dist/chunk-P7RKUESQ.mjs +37 -0
- package/dist/chunk-P7RKUESQ.mjs.map +1 -0
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +282 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -1
- package/package.json +16 -1
- package/dist/chunk-ALEJXAZY.mjs.map +0 -1
package/dist/Button.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
type ButtonVariant = 'primary' | 'secondary' | 'destructive' | 'ghost';
|
|
3
|
+
type ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'destructive' | 'destructive-secondary' | 'ghost';
|
|
4
4
|
type ButtonSize = 'small' | 'medium';
|
|
5
5
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
6
|
/**
|
package/dist/Button.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
type ButtonVariant = 'primary' | 'secondary' | 'destructive' | 'ghost';
|
|
3
|
+
type ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'destructive' | 'destructive-secondary' | 'ghost';
|
|
4
4
|
type ButtonSize = 'small' | 'medium';
|
|
5
5
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
6
|
/**
|
package/dist/Button.js
CHANGED
|
@@ -102,6 +102,32 @@ var buttonStyles = {
|
|
|
102
102
|
cursor: "not-allowed"
|
|
103
103
|
}
|
|
104
104
|
},
|
|
105
|
+
tertiary: {
|
|
106
|
+
backgroundColor: "#efefef",
|
|
107
|
+
// grey-100
|
|
108
|
+
color: "#2f2f2f",
|
|
109
|
+
// grey-900
|
|
110
|
+
":hover": {
|
|
111
|
+
backgroundColor: "#dfdfdf"
|
|
112
|
+
// grey-200
|
|
113
|
+
},
|
|
114
|
+
":active": {
|
|
115
|
+
backgroundColor: "#d1d1d1"
|
|
116
|
+
// grey-300
|
|
117
|
+
},
|
|
118
|
+
":focus-visible": {
|
|
119
|
+
outline: "3px solid #3cad51",
|
|
120
|
+
// brand-500
|
|
121
|
+
outlineOffset: "0px"
|
|
122
|
+
},
|
|
123
|
+
":disabled": {
|
|
124
|
+
backgroundColor: "#f8f8f8",
|
|
125
|
+
// grey-050
|
|
126
|
+
color: "#b3b3b3",
|
|
127
|
+
// grey-400
|
|
128
|
+
cursor: "not-allowed"
|
|
129
|
+
}
|
|
130
|
+
},
|
|
105
131
|
destructive: {
|
|
106
132
|
backgroundColor: "#c93232",
|
|
107
133
|
// destructive-500
|
|
@@ -124,6 +150,36 @@ var buttonStyles = {
|
|
|
124
150
|
cursor: "not-allowed"
|
|
125
151
|
}
|
|
126
152
|
},
|
|
153
|
+
"destructive-secondary": {
|
|
154
|
+
backgroundColor: "#ffffff",
|
|
155
|
+
color: "#a62323",
|
|
156
|
+
// destructive-600
|
|
157
|
+
border: "1px solid #c93232",
|
|
158
|
+
// destructive-500
|
|
159
|
+
":hover": {
|
|
160
|
+
backgroundColor: "#a62323",
|
|
161
|
+
// destructive-600
|
|
162
|
+
color: "#ffffff",
|
|
163
|
+
border: "1px solid #a62323"
|
|
164
|
+
},
|
|
165
|
+
":active": {
|
|
166
|
+
backgroundColor: "#920a0a",
|
|
167
|
+
// destructive-700
|
|
168
|
+
color: "#ffffff",
|
|
169
|
+
border: "1px solid #920a0a"
|
|
170
|
+
},
|
|
171
|
+
":focus-visible": {
|
|
172
|
+
outline: "3px solid #3cad51",
|
|
173
|
+
// brand-500 (green focus ring)
|
|
174
|
+
outlineOffset: "0px"
|
|
175
|
+
},
|
|
176
|
+
":disabled": {
|
|
177
|
+
backgroundColor: "#ffffff",
|
|
178
|
+
color: "#b3b3b3",
|
|
179
|
+
border: "1px solid #d1d1d1",
|
|
180
|
+
cursor: "not-allowed"
|
|
181
|
+
}
|
|
182
|
+
},
|
|
127
183
|
ghost: {
|
|
128
184
|
backgroundColor: "transparent",
|
|
129
185
|
color: "#0b800b",
|
package/dist/Button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Button/index.ts","../src/Button/Button.tsx"],"sourcesContent":["export { Button } from './Button';\nexport type { ButtonProps } from './Button';\n","import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { clsx } from 'clsx';\n\nexport type ButtonVariant = 'primary' | 'secondary' | 'destructive' | 'ghost';\nexport type ButtonSize = 'small' | 'medium';\n\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * The visual style variant of the button\n * @default 'primary'\n */\n variant?: ButtonVariant;\n /**\n * The size of the button\n * @default 'medium'\n */\n size?: ButtonSize;\n /**\n * If true, the component will be rendered as a child element\n * and merge its props with the child\n */\n asChild?: boolean;\n /**\n * The content of the button\n */\n children: React.ReactNode;\n}\n\n// Arbor Design System button styles\nconst buttonStyles = {\n base: {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n fontFamily: \"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\",\n fontWeight: '500',\n borderRadius: '99px', // Pill shape\n border: 'none',\n cursor: 'pointer',\n transition: 'all 0.2s ease-in-out',\n outline: 'none',\n },\n variants: {\n primary: {\n backgroundColor: '#0e8a0e', // brand-600\n color: '#ffffff',\n ':hover': {\n backgroundColor: '#005700', // brand-800\n },\n ':active': {\n backgroundColor: '#024002', // brand-900\n },\n ':focus-visible': {\n outline: '3px solid #3cad51', // brand-500\n outlineOffset: '0px',\n },\n ':disabled': {\n backgroundColor: '#b3b3b3', // grey-400\n cursor: 'not-allowed',\n },\n },\n secondary: {\n backgroundColor: '#ffffff',\n color: '#2f2f2f', // grey-900\n border: '1px solid #d1d1d1', // grey-300\n ':hover': {\n backgroundColor: '#f8f8f8', // grey-050\n },\n ':active': {\n backgroundColor: '#efefef', // grey-100\n },\n ':focus-visible': {\n outline: '3px solid #3cad51', // brand-500\n outlineOffset: '0px',\n },\n ':disabled': {\n backgroundColor: '#f8f8f8',\n color: '#b3b3b3',\n cursor: 'not-allowed',\n },\n },\n destructive: {\n backgroundColor: '#c93232', // destructive-500\n color: '#ffffff',\n ':hover': {\n backgroundColor: '#920a0a', // destructive-700\n },\n ':active': {\n backgroundColor: '#610202', // destructive-800\n },\n ':focus-visible': {\n outline: '3px solid #e86565', // destructive-300\n outlineOffset: '0px',\n },\n ':disabled': {\n backgroundColor: '#b3b3b3',\n cursor: 'not-allowed',\n },\n },\n ghost: {\n backgroundColor: 'transparent',\n color: '#0b800b', // brand-700 for link style\n textDecoration: 'underline',\n ':hover': {\n color: '#005700', // brand-800\n },\n ':active': {\n color: '#024002', // brand-900\n },\n ':focus-visible': {\n outline: '3px solid #3cad51',\n outlineOffset: '2px',\n },\n ':disabled': {\n color: '#b3b3b3',\n cursor: 'not-allowed',\n },\n },\n },\n sizes: {\n small: {\n height: '32px',\n fontSize: '13px',\n padding: '8px 16px',\n },\n medium: {\n height: '36px',\n fontSize: '13px',\n padding: '8px 16px',\n },\n },\n};\n\n/**\n * Button component - Arbor Design System\n *\n * A flexible button component with pill-shaped design following Arbor's design system.\n * Supports primary (green), secondary (outlined), destructive (red), and ghost (link-style) variants.\n *\n * @example\n * ```tsx\n * <Button variant=\"primary\" size=\"medium\">\n * Save Changes\n * </Button>\n * ```\n */\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n variant = 'primary',\n size = 'medium',\n asChild = false,\n className,\n disabled,\n style,\n children,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onBlur,\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : 'button';\n const [isHovered, setIsHovered] = React.useState(false);\n const [isFocused, setIsFocused] = React.useState(false);\n\n const variantStyles = buttonStyles.variants[variant];\n const sizeStyles = buttonStyles.sizes[size];\n\n const combinedStyle: React.CSSProperties = {\n ...buttonStyles.base,\n ...variantStyles,\n ...sizeStyles,\n ...(isHovered && !disabled && variantStyles[':hover']),\n ...(isFocused && !disabled && variantStyles[':focus-visible']),\n ...(disabled && variantStyles[':disabled']),\n ...style,\n };\n\n const handleMouseEnter = (e: React.MouseEvent<HTMLButtonElement>) => {\n setIsHovered(true);\n onMouseEnter?.(e);\n };\n\n const handleMouseLeave = (e: React.MouseEvent<HTMLButtonElement>) => {\n setIsHovered(false);\n onMouseLeave?.(e);\n };\n\n const handleFocus = (e: React.FocusEvent<HTMLButtonElement>) => {\n setIsFocused(true);\n onFocus?.(e);\n };\n\n const handleBlur = (e: React.FocusEvent<HTMLButtonElement>) => {\n setIsFocused(false);\n onBlur?.(e);\n };\n\n return (\n <Comp\n ref={ref}\n className={clsx('arbor-button', className)}\n style={combinedStyle}\n disabled={disabled}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onFocus={handleFocus}\n onBlur={handleBlur}\n {...props}\n >\n {children}\n </Comp>\n );\n }\n);\n\nButton.displayName = 'Button';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,wBAAqB;AACrB,kBAAqB;AAyMf;AA7KN,IAAM,eAAe;AAAA,EACnB,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,cAAc;AAAA;AAAA,IACd,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,SAAS;AAAA,EACX;AAAA,EACA,UAAU;AAAA,IACR,SAAS;AAAA,MACP,iBAAiB;AAAA;AAAA,MACjB,OAAO;AAAA,MACP,UAAU;AAAA,QACR,iBAAiB;AAAA;AAAA,MACnB;AAAA,MACA,WAAW;AAAA,QACT,iBAAiB;AAAA;AAAA,MACnB;AAAA,MACA,kBAAkB;AAAA,QAChB,SAAS;AAAA;AAAA,QACT,eAAe;AAAA,MACjB;AAAA,MACA,aAAa;AAAA,QACX,iBAAiB;AAAA;AAAA,QACjB,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,IACA,WAAW;AAAA,MACT,iBAAiB;AAAA,MACjB,OAAO;AAAA;AAAA,MACP,QAAQ;AAAA;AAAA,MACR,UAAU;AAAA,QACR,iBAAiB;AAAA;AAAA,MACnB;AAAA,MACA,WAAW;AAAA,QACT,iBAAiB;AAAA;AAAA,MACnB;AAAA,MACA,kBAAkB;AAAA,QAChB,SAAS;AAAA;AAAA,QACT,eAAe;AAA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K;AACtD,UAAM,CAAC,WAAW,YAAY,IAAU,eAAS,KAAK;AAEtD,UAAM,gBAAgB,aAAa,SAAS,OAAO;AACnD,UAAM,aAAa,aAAa,MAAM,IAAI;AAE1C,UAAM,gBAAqC;AAAA,MACzC,GAAG,aAAa;AAAA,MAChB,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAI,aAAa,CAAC,YAAY,cAAc,QAAQ;AAAA,MACpD,GAAI,aAAa,CAAC,YAAY,cAAc,gBAAgB;AAAA,MAC5D,GAAI,YAAY,cAAc,WAAW;AAAA,MACzC,GAAG;AAAA,IACL;AAEA,UAAM,mBAAmB,CAAC,MAA2C;AACnE,mBAAa,IAAI;AACjB,qBAAe,CAAC;AAAA,IAClB;AAEA,UAAM,mBAAmB,CAAC,MAA2C;AACnE,mBAAa,KAAK;AAClB,qBAAe,CAAC;AAAA,IAClB;AAEA,UAAM,cAAc,CAAC,MAA2C;AAC9D,mBAAa,IAAI;AACjB,gBAAU,CAAC;AAAA,IACb;AAEA,UAAM,aAAa,CAAC,MAA2C;AAC7D,mBAAa,KAAK;AAClB,eAAS,CAAC;AAAA,IACZ;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW,kBAAK,gBAAgB,SAAS;AAAA,QACzC,OAAO;AAAA,QACP;AAAA,QACA,cAAc;AAAA,QACd,cAAc;AAAA,QACd,SAAS;AAAA,QACT,QAAQ;AAAA,QACP,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,OAAO,cAAc;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/Button/index.ts","../src/Button/Button.tsx"],"sourcesContent":["export { Button } from './Button';\nexport type { ButtonProps } from './Button';\n","import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { clsx } from 'clsx';\n\nexport type ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'destructive' | 'destructive-secondary' | 'ghost';\nexport type ButtonSize = 'small' | 'medium';\n\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * The visual style variant of the button\n * @default 'primary'\n */\n variant?: ButtonVariant;\n /**\n * The size of the button\n * @default 'medium'\n */\n size?: ButtonSize;\n /**\n * If true, the component will be rendered as a child element\n * and merge its props with the child\n */\n asChild?: boolean;\n /**\n * The content of the button\n */\n children: React.ReactNode;\n}\n\n// Arbor Design System button styles\nconst buttonStyles = {\n base: {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n fontFamily: \"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\",\n fontWeight: '500',\n borderRadius: '99px', // Pill shape\n border: 'none',\n cursor: 'pointer',\n transition: 'all 0.2s ease-in-out',\n outline: 'none',\n },\n variants: {\n primary: {\n backgroundColor: '#0e8a0e', // brand-600\n color: '#ffffff',\n ':hover': {\n backgroundColor: '#005700', // brand-800\n },\n ':active': {\n backgroundColor: '#024002', // brand-900\n },\n ':focus-visible': {\n outline: '3px solid #3cad51', // brand-500\n outlineOffset: '0px',\n },\n ':disabled': {\n backgroundColor: '#b3b3b3', // grey-400\n cursor: 'not-allowed',\n },\n },\n secondary: {\n backgroundColor: '#ffffff',\n color: '#2f2f2f', // grey-900\n border: '1px solid #d1d1d1', // grey-300\n ':hover': {\n backgroundColor: '#f8f8f8', // grey-050\n },\n ':active': {\n backgroundColor: '#efefef', // grey-100\n },\n ':focus-visible': {\n outline: '3px solid #3cad51', // brand-500\n outlineOffset: '0px',\n },\n ':disabled': {\n backgroundColor: '#f8f8f8',\n color: '#b3b3b3',\n cursor: 'not-allowed',\n },\n },\n tertiary: {\n backgroundColor: '#efefef', // grey-100\n color: '#2f2f2f', // grey-900\n ':hover': {\n backgroundColor: '#dfdfdf', // grey-200\n },\n ':active': {\n backgroundColor: '#d1d1d1', // grey-300\n },\n ':focus-visible': {\n outline: '3px solid #3cad51', // brand-500\n outlineOffset: '0px',\n },\n ':disabled': {\n backgroundColor: '#f8f8f8', // grey-050\n color: '#b3b3b3', // grey-400\n cursor: 'not-allowed',\n },\n },\n destructive: {\n backgroundColor: '#c93232', // destructive-500\n color: '#ffffff',\n ':hover': {\n backgroundColor: '#920a0a', // destructive-700\n },\n ':active': {\n backgroundColor: '#610202', // destructive-800\n },\n ':focus-visible': {\n outline: '3px solid #e86565', // destructive-300\n outlineOffset: '0px',\n },\n ':disabled': {\n backgroundColor: '#b3b3b3',\n cursor: 'not-allowed',\n },\n },\n 'destructive-secondary': {\n backgroundColor: '#ffffff',\n color: '#a62323', // destructive-600\n border: '1px solid #c93232', // destructive-500\n ':hover': {\n backgroundColor: '#a62323', // destructive-600\n color: '#ffffff',\n border: '1px solid #a62323',\n },\n ':active': {\n backgroundColor: '#920a0a', // destructive-700\n color: '#ffffff',\n border: '1px solid #920a0a',\n },\n ':focus-visible': {\n outline: '3px solid #3cad51', // brand-500 (green focus ring)\n outlineOffset: '0px',\n },\n ':disabled': {\n backgroundColor: '#ffffff',\n color: '#b3b3b3',\n border: '1px solid #d1d1d1',\n cursor: 'not-allowed',\n },\n },\n ghost: {\n backgroundColor: 'transparent',\n color: '#0b800b', // brand-700 for link style\n textDecoration: 'underline',\n ':hover': {\n color: '#005700', // brand-800\n },\n ':active': {\n color: '#024002', // brand-900\n },\n ':focus-visible': {\n outline: '3px solid #3cad51',\n outlineOffset: '2px',\n },\n ':disabled': {\n color: '#b3b3b3',\n cursor: 'not-allowed',\n },\n },\n },\n sizes: {\n small: {\n height: '32px',\n fontSize: '13px',\n padding: '8px 16px',\n },\n medium: {\n height: '36px',\n fontSize: '13px',\n padding: '8px 16px',\n },\n },\n};\n\n/**\n * Button component - Arbor Design System\n *\n * A flexible button component with pill-shaped design following Arbor's design system.\n * Supports primary (green), secondary (outlined), destructive (red), and ghost (link-style) variants.\n *\n * @example\n * ```tsx\n * <Button variant=\"primary\" size=\"medium\">\n * Save Changes\n * </Button>\n * ```\n */\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n variant = 'primary',\n size = 'medium',\n asChild = false,\n className,\n disabled,\n style,\n children,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onBlur,\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : 'button';\n const [isHovered, setIsHovered] = React.useState(false);\n const [isFocused, setIsFocused] = React.useState(false);\n\n const variantStyles = buttonStyles.variants[variant];\n const sizeStyles = buttonStyles.sizes[size];\n\n const combinedStyle: React.CSSProperties = {\n ...buttonStyles.base,\n ...variantStyles,\n ...sizeStyles,\n ...(isHovered && !disabled && variantStyles[':hover']),\n ...(isFocused && !disabled && variantStyles[':focus-visible']),\n ...(disabled && variantStyles[':disabled']),\n ...style,\n };\n\n const handleMouseEnter = (e: React.MouseEvent<HTMLButtonElement>) => {\n setIsHovered(true);\n onMouseEnter?.(e);\n };\n\n const handleMouseLeave = (e: React.MouseEvent<HTMLButtonElement>) => {\n setIsHovered(false);\n onMouseLeave?.(e);\n };\n\n const handleFocus = (e: React.FocusEvent<HTMLButtonElement>) => {\n setIsFocused(true);\n onFocus?.(e);\n };\n\n const handleBlur = (e: React.FocusEvent<HTMLButtonElement>) => {\n setIsFocused(false);\n onBlur?.(e);\n };\n\n return (\n <Comp\n ref={ref}\n className={clsx('arbor-button', className)}\n style={combinedStyle}\n disabled={disabled}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onFocus={handleFocus}\n onBlur={handleBlur}\n {...props}\n >\n {children}\n </Comp>\n );\n }\n);\n\nButton.displayName = 'Button';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,wBAAqB;AACrB,kBAAqB;AAqPf;AAzNN,IAAM,eAAe;AAAA,EACnB,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,cAAc;AAAA;AAAA,IACd,QAAQ;AA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.d.mts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface ModalProps {
|
|
4
|
+
/**
|
|
5
|
+
* The content of the modal (typically ModalHeader, content, and ModalFooter)
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Width of the modal
|
|
10
|
+
* @default 584
|
|
11
|
+
*/
|
|
12
|
+
width?: number | string;
|
|
13
|
+
/**
|
|
14
|
+
* Additional CSS class name
|
|
15
|
+
*/
|
|
16
|
+
className?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Additional inline styles
|
|
19
|
+
*/
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
}
|
|
22
|
+
interface ModalContentProps {
|
|
23
|
+
/**
|
|
24
|
+
* The content to display in the modal body
|
|
25
|
+
*/
|
|
26
|
+
children: React.ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* Additional CSS class name
|
|
29
|
+
*/
|
|
30
|
+
className?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Additional inline styles
|
|
33
|
+
*/
|
|
34
|
+
style?: React.CSSProperties;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Modal component - Arbor Design System
|
|
38
|
+
*
|
|
39
|
+
* A modal dialog container that wraps ModalHeader, content, and ModalFooter.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* <Modal width={584}>
|
|
44
|
+
* <ModalHeader
|
|
45
|
+
* title="Delete postal address?"
|
|
46
|
+
* onClose={() => setIsOpen(false)}
|
|
47
|
+
* />
|
|
48
|
+
* <ModalContent>
|
|
49
|
+
* <p>This will delete the postal address. Are you sure?</p>
|
|
50
|
+
* </ModalContent>
|
|
51
|
+
* <ModalFooter>
|
|
52
|
+
* <Button variant="tertiary">Cancel</Button>
|
|
53
|
+
* <Button variant="destructive-secondary">Confirm</Button>
|
|
54
|
+
* </ModalFooter>
|
|
55
|
+
* </Modal>
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
declare const Modal: React.ForwardRefExoticComponent<ModalProps & React.RefAttributes<HTMLDivElement>>;
|
|
59
|
+
/**
|
|
60
|
+
* ModalContent component - Arbor Design System
|
|
61
|
+
*
|
|
62
|
+
* The content/body area of a modal dialog.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```tsx
|
|
66
|
+
* <ModalContent>
|
|
67
|
+
* <p>Your content here</p>
|
|
68
|
+
* </ModalContent>
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
declare const ModalContent: React.ForwardRefExoticComponent<ModalContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
72
|
+
|
|
73
|
+
export { Modal, ModalContent, type ModalContentProps, type ModalProps };
|
package/dist/Modal.d.ts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface ModalProps {
|
|
4
|
+
/**
|
|
5
|
+
* The content of the modal (typically ModalHeader, content, and ModalFooter)
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Width of the modal
|
|
10
|
+
* @default 584
|
|
11
|
+
*/
|
|
12
|
+
width?: number | string;
|
|
13
|
+
/**
|
|
14
|
+
* Additional CSS class name
|
|
15
|
+
*/
|
|
16
|
+
className?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Additional inline styles
|
|
19
|
+
*/
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
}
|
|
22
|
+
interface ModalContentProps {
|
|
23
|
+
/**
|
|
24
|
+
* The content to display in the modal body
|
|
25
|
+
*/
|
|
26
|
+
children: React.ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* Additional CSS class name
|
|
29
|
+
*/
|
|
30
|
+
className?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Additional inline styles
|
|
33
|
+
*/
|
|
34
|
+
style?: React.CSSProperties;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Modal component - Arbor Design System
|
|
38
|
+
*
|
|
39
|
+
* A modal dialog container that wraps ModalHeader, content, and ModalFooter.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* <Modal width={584}>
|
|
44
|
+
* <ModalHeader
|
|
45
|
+
* title="Delete postal address?"
|
|
46
|
+
* onClose={() => setIsOpen(false)}
|
|
47
|
+
* />
|
|
48
|
+
* <ModalContent>
|
|
49
|
+
* <p>This will delete the postal address. Are you sure?</p>
|
|
50
|
+
* </ModalContent>
|
|
51
|
+
* <ModalFooter>
|
|
52
|
+
* <Button variant="tertiary">Cancel</Button>
|
|
53
|
+
* <Button variant="destructive-secondary">Confirm</Button>
|
|
54
|
+
* </ModalFooter>
|
|
55
|
+
* </Modal>
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
declare const Modal: React.ForwardRefExoticComponent<ModalProps & React.RefAttributes<HTMLDivElement>>;
|
|
59
|
+
/**
|
|
60
|
+
* ModalContent component - Arbor Design System
|
|
61
|
+
*
|
|
62
|
+
* The content/body area of a modal dialog.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```tsx
|
|
66
|
+
* <ModalContent>
|
|
67
|
+
* <p>Your content here</p>
|
|
68
|
+
* </ModalContent>
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
declare const ModalContent: React.ForwardRefExoticComponent<ModalContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
72
|
+
|
|
73
|
+
export { Modal, ModalContent, type ModalContentProps, type ModalProps };
|
package/dist/Modal.js
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/Modal/index.ts
|
|
31
|
+
var Modal_exports = {};
|
|
32
|
+
__export(Modal_exports, {
|
|
33
|
+
Modal: () => Modal,
|
|
34
|
+
ModalContent: () => ModalContent
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(Modal_exports);
|
|
37
|
+
|
|
38
|
+
// src/Modal/Modal.tsx
|
|
39
|
+
var React = __toESM(require("react"));
|
|
40
|
+
var import_clsx = require("clsx");
|
|
41
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
|
+
var modalStyles = {
|
|
43
|
+
container: {
|
|
44
|
+
display: "flex",
|
|
45
|
+
flexDirection: "column",
|
|
46
|
+
alignItems: "flex-start",
|
|
47
|
+
backgroundColor: "#f8f8f8",
|
|
48
|
+
// grey-050
|
|
49
|
+
borderRadius: "8px",
|
|
50
|
+
boxShadow: "0px 8px 24px 0px rgba(32, 32, 32, 0.12)",
|
|
51
|
+
overflow: "hidden",
|
|
52
|
+
boxSizing: "border-box",
|
|
53
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
54
|
+
},
|
|
55
|
+
content: {
|
|
56
|
+
display: "flex",
|
|
57
|
+
alignItems: "center",
|
|
58
|
+
justifyContent: "center",
|
|
59
|
+
width: "100%",
|
|
60
|
+
padding: "32px 16px",
|
|
61
|
+
backgroundColor: "#f8f8f8",
|
|
62
|
+
// grey-050
|
|
63
|
+
boxSizing: "border-box"
|
|
64
|
+
},
|
|
65
|
+
contentText: {
|
|
66
|
+
flex: 1,
|
|
67
|
+
fontSize: "13px",
|
|
68
|
+
fontWeight: "400",
|
|
69
|
+
color: "#2f2f2f",
|
|
70
|
+
lineHeight: "1.5"
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
var Modal = React.forwardRef(
|
|
74
|
+
({ children, width = 584, className, style, ...props }, ref) => {
|
|
75
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
ref,
|
|
79
|
+
className: (0, import_clsx.clsx)("arbor-modal", className),
|
|
80
|
+
style: {
|
|
81
|
+
...modalStyles.container,
|
|
82
|
+
width: typeof width === "number" ? `${width}px` : width,
|
|
83
|
+
...style
|
|
84
|
+
},
|
|
85
|
+
role: "dialog",
|
|
86
|
+
"aria-modal": "true",
|
|
87
|
+
...props,
|
|
88
|
+
children
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
Modal.displayName = "Modal";
|
|
94
|
+
var ModalContent = React.forwardRef(
|
|
95
|
+
({ children, className, style, ...props }, ref) => {
|
|
96
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
97
|
+
"div",
|
|
98
|
+
{
|
|
99
|
+
ref,
|
|
100
|
+
className: (0, import_clsx.clsx)("arbor-modal-content", className),
|
|
101
|
+
style: { ...modalStyles.content, ...style },
|
|
102
|
+
...props,
|
|
103
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: modalStyles.contentText, children })
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
ModalContent.displayName = "ModalContent";
|
|
109
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
110
|
+
0 && (module.exports = {
|
|
111
|
+
Modal,
|
|
112
|
+
ModalContent
|
|
113
|
+
});
|
|
114
|
+
//# sourceMappingURL=Modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Modal/index.ts","../src/Modal/Modal.tsx"],"sourcesContent":["export { Modal, ModalContent } from './Modal';\nexport type { ModalProps, ModalContentProps } from './Modal';\n","import * as React from 'react';\nimport { clsx } from 'clsx';\n\nexport interface ModalProps {\n /**\n * The content of the modal (typically ModalHeader, content, and ModalFooter)\n */\n children: React.ReactNode;\n /**\n * Width of the modal\n * @default 584\n */\n width?: number | string;\n /**\n * Additional CSS class name\n */\n className?: string;\n /**\n * Additional inline styles\n */\n style?: React.CSSProperties;\n}\n\nexport interface ModalContentProps {\n /**\n * The content to display in the modal body\n */\n children: React.ReactNode;\n /**\n * Additional CSS class name\n */\n className?: string;\n /**\n * Additional inline styles\n */\n style?: React.CSSProperties;\n}\n\n// Arbor Design System modal styles\nconst modalStyles = {\n container: {\n display: 'flex',\n flexDirection: 'column' as const,\n alignItems: 'flex-start',\n backgroundColor: '#f8f8f8', // grey-050\n borderRadius: '8px',\n boxShadow: '0px 8px 24px 0px rgba(32, 32, 32, 0.12)',\n overflow: 'hidden',\n boxSizing: 'border-box' as const,\n fontFamily: \"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\",\n },\n content: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '100%',\n padding: '32px 16px',\n backgroundColor: '#f8f8f8', // grey-050\n boxSizing: 'border-box' as const,\n },\n contentText: {\n flex: 1,\n fontSize: '13px',\n fontWeight: '400',\n color: '#2f2f2f',\n lineHeight: '1.5',\n },\n};\n\n/**\n * Modal component - Arbor Design System\n *\n * A modal dialog container that wraps ModalHeader, content, and ModalFooter.\n *\n * @example\n * ```tsx\n * <Modal width={584}>\n * <ModalHeader\n * title=\"Delete postal address?\"\n * onClose={() => setIsOpen(false)}\n * />\n * <ModalContent>\n * <p>This will delete the postal address. Are you sure?</p>\n * </ModalContent>\n * <ModalFooter>\n * <Button variant=\"tertiary\">Cancel</Button>\n * <Button variant=\"destructive-secondary\">Confirm</Button>\n * </ModalFooter>\n * </Modal>\n * ```\n */\nexport const Modal = React.forwardRef<HTMLDivElement, ModalProps>(\n ({ children, width = 584, className, style, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={clsx('arbor-modal', className)}\n style={{\n ...modalStyles.container,\n width: typeof width === 'number' ? `${width}px` : width,\n ...style,\n }}\n role=\"dialog\"\n aria-modal=\"true\"\n {...props}\n >\n {children}\n </div>\n );\n }\n);\n\nModal.displayName = 'Modal';\n\n/**\n * ModalContent component - Arbor Design System\n *\n * The content/body area of a modal dialog.\n *\n * @example\n * ```tsx\n * <ModalContent>\n * <p>Your content here</p>\n * </ModalContent>\n * ```\n */\nexport const ModalContent = React.forwardRef<HTMLDivElement, ModalContentProps>(\n ({ children, className, style, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={clsx('arbor-modal-content', className)}\n style={{ ...modalStyles.content, ...style }}\n {...props}\n >\n <div style={modalStyles.contentText}>{children}</div>\n </div>\n );\n }\n);\n\nModalContent.displayName = 'ModalContent';\n"],"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MAAM;AAAA,QACzC,GAAG;AAAA,QAEJ,sDAAC,SAAI,OAAO,YAAY,aAAc,UAAS;AAAA;AAAA,IACjD;AAAA,EAEJ;AACF;AAEA,aAAa,cAAc;","names":[]}
|
package/dist/Modal.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface ModalFooterProps {
|
|
4
|
+
/**
|
|
5
|
+
* The content of the footer, typically buttons
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Additional CSS class name
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Additional inline styles
|
|
14
|
+
*/
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* ModalFooter component - Arbor Design System
|
|
19
|
+
*
|
|
20
|
+
* The footer part of a modal dialog, typically containing action buttons.
|
|
21
|
+
* Buttons are right-aligned by default.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* // Footer with two buttons
|
|
26
|
+
* <ModalFooter>
|
|
27
|
+
* <Button variant="tertiary">Cancel</Button>
|
|
28
|
+
* <Button variant="primary">Save</Button>
|
|
29
|
+
* </ModalFooter>
|
|
30
|
+
*
|
|
31
|
+
* // Footer with destructive action
|
|
32
|
+
* <ModalFooter>
|
|
33
|
+
* <Button variant="tertiary">Cancel</Button>
|
|
34
|
+
* <Button variant="destructive-secondary">Delete</Button>
|
|
35
|
+
* </ModalFooter>
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
declare const ModalFooter: React.ForwardRefExoticComponent<ModalFooterProps & React.RefAttributes<HTMLDivElement>>;
|
|
39
|
+
|
|
40
|
+
export { ModalFooter, type ModalFooterProps };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface ModalFooterProps {
|
|
4
|
+
/**
|
|
5
|
+
* The content of the footer, typically buttons
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Additional CSS class name
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Additional inline styles
|
|
14
|
+
*/
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* ModalFooter component - Arbor Design System
|
|
19
|
+
*
|
|
20
|
+
* The footer part of a modal dialog, typically containing action buttons.
|
|
21
|
+
* Buttons are right-aligned by default.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* // Footer with two buttons
|
|
26
|
+
* <ModalFooter>
|
|
27
|
+
* <Button variant="tertiary">Cancel</Button>
|
|
28
|
+
* <Button variant="primary">Save</Button>
|
|
29
|
+
* </ModalFooter>
|
|
30
|
+
*
|
|
31
|
+
* // Footer with destructive action
|
|
32
|
+
* <ModalFooter>
|
|
33
|
+
* <Button variant="tertiary">Cancel</Button>
|
|
34
|
+
* <Button variant="destructive-secondary">Delete</Button>
|
|
35
|
+
* </ModalFooter>
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
declare const ModalFooter: React.ForwardRefExoticComponent<ModalFooterProps & React.RefAttributes<HTMLDivElement>>;
|
|
39
|
+
|
|
40
|
+
export { ModalFooter, type ModalFooterProps };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/ModalFooter/index.ts
|
|
31
|
+
var ModalFooter_exports = {};
|
|
32
|
+
__export(ModalFooter_exports, {
|
|
33
|
+
ModalFooter: () => ModalFooter
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(ModalFooter_exports);
|
|
36
|
+
|
|
37
|
+
// src/ModalFooter/ModalFooter.tsx
|
|
38
|
+
var React = __toESM(require("react"));
|
|
39
|
+
var import_clsx = require("clsx");
|
|
40
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
41
|
+
var modalFooterStyles = {
|
|
42
|
+
container: {
|
|
43
|
+
display: "flex",
|
|
44
|
+
alignItems: "center",
|
|
45
|
+
justifyContent: "flex-end",
|
|
46
|
+
gap: "16px",
|
|
47
|
+
width: "100%",
|
|
48
|
+
padding: "16px",
|
|
49
|
+
backgroundColor: "#ffffff",
|
|
50
|
+
boxSizing: "border-box",
|
|
51
|
+
maxHeight: "56px"
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
var ModalFooter = React.forwardRef(
|
|
55
|
+
({ children, className, style, ...props }, ref) => {
|
|
56
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
ref,
|
|
60
|
+
className: (0, import_clsx.clsx)("arbor-modal-footer", className),
|
|
61
|
+
style: { ...modalFooterStyles.container, ...style },
|
|
62
|
+
...props,
|
|
63
|
+
children
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
ModalFooter.displayName = "ModalFooter";
|
|
69
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
70
|
+
0 && (module.exports = {
|
|
71
|
+
ModalFooter
|
|
72
|
+
});
|
|
73
|
+
//# sourceMappingURL=ModalFooter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ModalFooter/index.ts","../src/ModalFooter/ModalFooter.tsx"],"sourcesContent":["export { ModalFooter } from './ModalFooter';\nexport type { ModalFooterProps } from './ModalFooter';\n","import * as React from 'react';\nimport { clsx } from 'clsx';\n\nexport interface ModalFooterProps {\n /**\n * The content of the footer, typically buttons\n */\n children: React.ReactNode;\n /**\n * Additional CSS class name\n */\n className?: string;\n /**\n * Additional inline styles\n */\n style?: React.CSSProperties;\n}\n\n// Arbor Design System modal footer styles\nconst modalFooterStyles = {\n container: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-end',\n gap: '16px',\n width: '100%',\n padding: '16px',\n backgroundColor: '#ffffff',\n boxSizing: 'border-box' as const,\n maxHeight: '56px',\n },\n};\n\n/**\n * ModalFooter component - Arbor Design System\n *\n * The footer part of a modal dialog, typically containing action buttons.\n * Buttons are right-aligned by default.\n *\n * @example\n * ```tsx\n * // Footer with two buttons\n * <ModalFooter>\n * <Button variant=\"tertiary\">Cancel</Button>\n * <Button variant=\"primary\">Save</Button>\n * </ModalFooter>\n *\n * // Footer with destructive action\n * <ModalFooter>\n * <Button variant=\"tertiary\">Cancel</Button>\n * <Button variant=\"destructive-secondary\">Delete</Button>\n * </ModalFooter>\n * ```\n */\nexport const ModalFooter = React.forwardRef<HTMLDivElement, ModalFooterProps>(\n ({ children, className, style, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={clsx('arbor-modal-footer', className)}\n style={{ ...modalFooterStyles.container, ...style }}\n {...props}\n >\n {children}\n </div>\n );\n }\n);\n\nModalFooter.displayName = 'ModalFooter';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,kBAAqB;AAwDf;AAtCN,IAAM,oBAAoB;AAAA,EACxB,WAAW;AAAA,IACT,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,KAAK;AAAA,IACL,OAAO;AAAA,IACP,SAAS;AAAA,IACT,iBAAiB;AAAA,IACjB,WAAW;AAAA,IACX,WAAW;AAAA,EACb;AACF;AAuBO,IAAM,cAAoB;AAAA,EAC/B,CAAC,EAAE,UAAU,WAAW,OAAO,GAAG,MAAM,GAAG,QAAQ;AACjD,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW,kBAAK,sBAAsB,SAAS;AAAA,QAC/C,OAAO,EAAE,GAAG,kBAAkB,WAAW,GAAG,MAAM;AAAA,QACjD,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|