@app-studio/web 0.9.78 → 0.9.80
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/Button/Button/Button.props.d.ts +1 -1
- package/dist/components/Button/Button/Button.style.d.ts +1 -1
- package/dist/components/Card/Card/Card.style.d.ts +0 -4
- package/dist/components/Form/Switch/Switch/Switch.style.d.ts +3 -6
- package/dist/providers/index.d.ts +5 -0
- package/dist/web.cjs.development.js +133 -110
- package/dist/web.cjs.development.js.map +1 -1
- package/dist/web.cjs.production.min.js +1 -1
- package/dist/web.cjs.production.min.js.map +1 -1
- package/dist/web.esm.js +133 -110
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +137 -114
- package/dist/web.umd.development.js.map +1 -1
- package/dist/web.umd.production.min.js +1 -1
- package/dist/web.umd.production.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -23,7 +23,7 @@ export interface ButtonProps extends Omit<$ButtonProps, 'size'> {
|
|
|
23
23
|
variant?: Variant;
|
|
24
24
|
animation?: Animation;
|
|
25
25
|
color?: string;
|
|
26
|
-
|
|
26
|
+
textColor?: string;
|
|
27
27
|
reversed?: boolean;
|
|
28
28
|
borderMovingDuration?: number;
|
|
29
29
|
borderMovingGradientColors?: string[];
|
|
@@ -21,7 +21,7 @@ export declare const ButtonShapes: Record<Shape, number | string>;
|
|
|
21
21
|
* Icon sizes for different button sizes
|
|
22
22
|
*/
|
|
23
23
|
export declare const IconSizes: Record<Size, ViewProps>;
|
|
24
|
-
export declare const getButtonVariants: (color: string,
|
|
24
|
+
export declare const getButtonVariants: (color: string, textColor: string, reversed?: boolean) => Record<Variant, ViewProps>;
|
|
25
25
|
/**
|
|
26
26
|
* Generate offset path for border animation
|
|
27
27
|
*/
|
|
@@ -22,10 +22,6 @@ export declare const CardShapes: Record<Shape, number | string>;
|
|
|
22
22
|
* Get card variants with consistent styling based on theme mode
|
|
23
23
|
*/
|
|
24
24
|
export declare const getCardVariants: (themeMode: string) => Record<Variant, ViewProps>;
|
|
25
|
-
/**
|
|
26
|
-
* Default card variants (for backward compatibility)
|
|
27
|
-
*/
|
|
28
|
-
export declare const CardVariants: Record<Variant, ViewProps>;
|
|
29
25
|
/**
|
|
30
26
|
* Function to get default styles for Card components
|
|
31
27
|
* @param theme - Theme object from useTheme hook
|
|
@@ -37,12 +37,9 @@ export declare const ColorSchemes: {
|
|
|
37
37
|
};
|
|
38
38
|
states: {
|
|
39
39
|
hover: {
|
|
40
|
-
active:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
inactive: {
|
|
44
|
-
backgroundColor: string;
|
|
45
|
-
};
|
|
40
|
+
active: string;
|
|
41
|
+
inactive: string;
|
|
42
|
+
activeOpacity: number;
|
|
46
43
|
};
|
|
47
44
|
focus: {
|
|
48
45
|
active: {
|
|
@@ -31,7 +31,6 @@ require('core-js/modules/es.parse-int.js');
|
|
|
31
31
|
var reactRouterDom = require('react-router-dom');
|
|
32
32
|
require('core-js/modules/es.parse-float.js');
|
|
33
33
|
require('core-js/modules/es.string.ends-with.js');
|
|
34
|
-
var contrast = _interopDefault(require('contrast'));
|
|
35
34
|
require('core-js/modules/es.promise.js');
|
|
36
35
|
require('core-js/modules/es.array.reduce.js');
|
|
37
36
|
require('core-js/modules/es.number.to-fixed.js');
|
|
@@ -42,6 +41,7 @@ require('core-js/modules/es.regexp.exec.js');
|
|
|
42
41
|
var formik = require('formik');
|
|
43
42
|
require('core-js/modules/es.string.replace.js');
|
|
44
43
|
require('core-js/modules/es.string.split.js');
|
|
44
|
+
var contrast = _interopDefault(require('contrast'));
|
|
45
45
|
require('core-js/modules/es.promise.finally.js');
|
|
46
46
|
require('core-js/modules/es.string.match.js');
|
|
47
47
|
require('core-js/modules/es.string.search.js');
|
|
@@ -2785,11 +2785,10 @@ var IconSizes$1 = {
|
|
|
2785
2785
|
padding: 14
|
|
2786
2786
|
}
|
|
2787
2787
|
};
|
|
2788
|
-
var getButtonVariants = function getButtonVariants(color,
|
|
2788
|
+
var getButtonVariants = function getButtonVariants(color, textColor, reversed) {
|
|
2789
2789
|
if (reversed === void 0) {
|
|
2790
2790
|
reversed = false;
|
|
2791
2791
|
}
|
|
2792
|
-
var textColor = isLight ? '#000000' : '#FFFFFF';
|
|
2793
2792
|
// Determine effective colors based on reversed state
|
|
2794
2793
|
var effectiveBg = reversed ? textColor : color;
|
|
2795
2794
|
var effectiveContent = reversed ? color : textColor;
|
|
@@ -2916,8 +2915,8 @@ var getButtonVariants = function getButtonVariants(color, isLight, reversed) {
|
|
|
2916
2915
|
|
|
2917
2916
|
var _excluded$d = ["asComponent", "isDisabled", "isLoading", "isWrapped", "borderRadius", "width", "height", "baseStyles", "sizeStyles", "iconPad", "mainTone", "resolvedTextColor", "children", "borderWidth"],
|
|
2918
2917
|
_excluded2$3 = ["shape", "isDisabled", "onClick", "shadow", "borderWidth", "isAuto", "isFilled", "views", "children"],
|
|
2919
|
-
_excluded3$2 = ["variant", "animation", "to", "isDisabled", "isLoading", "isAuto", "isFilled", "isExternal", "shape", "shadow", "onClick", "views", "baseStyles", "sizeStyles", "iconPad", "resolvedTextColor", "content", "size", "mainTone", "
|
|
2920
|
-
_excluded4$2 = ["variant", "size", "shape", "iconPosition", "loaderPosition", "backgroundColor", "color", "
|
|
2918
|
+
_excluded3$2 = ["variant", "animation", "to", "isDisabled", "isLoading", "isAuto", "isFilled", "isExternal", "shape", "shadow", "onClick", "views", "baseStyles", "sizeStyles", "iconPad", "resolvedTextColor", "content", "size", "mainTone", "borderMovingDuration", "borderMovingGradientColors", "animatedStrokeAccentColor", "animatedStrokeTextColor", "getColor"],
|
|
2919
|
+
_excluded4$2 = ["variant", "size", "shape", "iconPosition", "loaderPosition", "backgroundColor", "color", "textColor", "reversed", "isAuto", "isFilled", "isDisabled", "isLoading", "isIconRounded", "icon", "children", "to", "isExternal", "shadow", "onClick", "views", "borderMovingDuration", "borderMovingGradientColors", "animatedStrokeAccentColor", "animatedStrokeTextColor"];
|
|
2921
2920
|
// --- Helper: Button Content ---
|
|
2922
2921
|
// Renders the inner content: Loader, Icon, and Children.
|
|
2923
2922
|
var ButtonContent = _ref => {
|
|
@@ -3277,7 +3276,7 @@ var StandardButton = _ref4 => {
|
|
|
3277
3276
|
// --- Main Component ---
|
|
3278
3277
|
// --- Main Component ---
|
|
3279
3278
|
var ButtonView = _ref5 => {
|
|
3280
|
-
var _ref6,
|
|
3279
|
+
var _ref6, _base$color;
|
|
3281
3280
|
var {
|
|
3282
3281
|
/* behaviour */
|
|
3283
3282
|
variant = 'filled',
|
|
@@ -3286,13 +3285,13 @@ var ButtonView = _ref5 => {
|
|
|
3286
3285
|
iconPosition = 'left',
|
|
3287
3286
|
loaderPosition = 'left',
|
|
3288
3287
|
backgroundColor,
|
|
3289
|
-
//
|
|
3288
|
+
// Primary override for main color
|
|
3290
3289
|
color,
|
|
3291
|
-
//
|
|
3292
|
-
|
|
3293
|
-
//
|
|
3290
|
+
// Main button color (theme tokens or color palette)
|
|
3291
|
+
textColor,
|
|
3292
|
+
// Explicit text color
|
|
3294
3293
|
reversed = false,
|
|
3295
|
-
//
|
|
3294
|
+
// Reverse colors for dark backgrounds
|
|
3296
3295
|
isAuto = true,
|
|
3297
3296
|
isFilled,
|
|
3298
3297
|
isDisabled,
|
|
@@ -3317,24 +3316,30 @@ var ButtonView = _ref5 => {
|
|
|
3317
3316
|
props = _objectWithoutPropertiesLoose(_ref5, _excluded4$2);
|
|
3318
3317
|
/* theme helpers */
|
|
3319
3318
|
var {
|
|
3320
|
-
getColorHex
|
|
3321
|
-
themeMode
|
|
3319
|
+
getColorHex
|
|
3322
3320
|
} = appStudio.useTheme();
|
|
3323
3321
|
/* MAIN COLOR – determines the entire palette */
|
|
3324
|
-
|
|
3325
|
-
var
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3322
|
+
// Priority: explicit backgroundColor/color prop -> theme.button.background -> theme.primary
|
|
3323
|
+
var mainColorKey = (_ref6 = backgroundColor != null ? backgroundColor : color) != null ? _ref6 : 'theme.button.background';
|
|
3324
|
+
// Decide which theme token to resolve based on state
|
|
3325
|
+
var stateColorKey = isDisabled ? 'theme.disabled' : isLoading ? 'theme.loading' : mainColorKey;
|
|
3326
|
+
// Resolve to actual hex color.
|
|
3327
|
+
// If 'theme.button.background' isn't defined, it falls back to 'theme.primary'
|
|
3328
|
+
var mainTone = getColorHex(stateColorKey);
|
|
3329
|
+
if (mainTone === 'theme.button.background' || mainTone === 'theme.loading') {
|
|
3330
|
+
mainTone = getColorHex(isLoading ? 'color.dark.500' : 'theme.primary');
|
|
3331
|
+
}
|
|
3332
|
+
/* text color - explicitly provided or default to white */
|
|
3333
|
+
// Priority: explicit textColor prop -> theme.button.text -> color.white
|
|
3334
|
+
var resolvedTextColorKey = textColor != null ? textColor : 'theme.button.text';
|
|
3335
|
+
var resolvedTextColor = getColorHex(resolvedTextColorKey);
|
|
3336
|
+
if (resolvedTextColor === 'theme.button.text') {
|
|
3337
|
+
resolvedTextColor = getColorHex('color.white');
|
|
3333
3338
|
}
|
|
3334
3339
|
/* variant palette */
|
|
3335
|
-
var palette = React.useMemo(() => getButtonVariants(mainTone,
|
|
3340
|
+
var palette = React.useMemo(() => getButtonVariants(mainTone, resolvedTextColor, reversed), [mainTone, resolvedTextColor, reversed]);
|
|
3336
3341
|
var base = palette[variant];
|
|
3337
|
-
var
|
|
3342
|
+
var finalContentColor = (_base$color = base == null ? void 0 : base.color) != null ? _base$color : resolvedTextColor;
|
|
3338
3343
|
// Render content logic safely
|
|
3339
3344
|
var content = /*#__PURE__*/React__default.createElement(ButtonContent, {
|
|
3340
3345
|
icon: icon,
|
|
@@ -3342,7 +3347,7 @@ var ButtonView = _ref5 => {
|
|
|
3342
3347
|
iconPosition: iconPosition,
|
|
3343
3348
|
loaderPosition: loaderPosition,
|
|
3344
3349
|
size: size,
|
|
3345
|
-
resolvedTextColor:
|
|
3350
|
+
resolvedTextColor: finalContentColor,
|
|
3346
3351
|
isIconRounded: isIconRounded,
|
|
3347
3352
|
views: views
|
|
3348
3353
|
}, children);
|
|
@@ -3365,11 +3370,10 @@ var ButtonView = _ref5 => {
|
|
|
3365
3370
|
baseStyles: base,
|
|
3366
3371
|
sizeStyles: sizeStyles,
|
|
3367
3372
|
iconPad: iconPad,
|
|
3368
|
-
resolvedTextColor:
|
|
3373
|
+
resolvedTextColor: finalContentColor,
|
|
3369
3374
|
content: content,
|
|
3370
3375
|
size: size,
|
|
3371
3376
|
mainTone: mainTone,
|
|
3372
|
-
tone: tone,
|
|
3373
3377
|
borderMovingDuration: borderMovingDuration,
|
|
3374
3378
|
borderMovingGradientColors: borderMovingGradientColors,
|
|
3375
3379
|
animatedStrokeAccentColor: animatedStrokeAccentColor,
|
|
@@ -3404,50 +3408,57 @@ var Button = ButtonComponent;
|
|
|
3404
3408
|
* - Rounded corners: Consistent border radius
|
|
3405
3409
|
* - Transitions: Subtle animations
|
|
3406
3410
|
*/
|
|
3411
|
+
/**
|
|
3412
|
+
* Card sizes following the 4px grid system
|
|
3413
|
+
*/
|
|
3414
|
+
var CardSizes = {
|
|
3415
|
+
sm: {
|
|
3416
|
+
padding: '12px'
|
|
3417
|
+
},
|
|
3418
|
+
md: {
|
|
3419
|
+
padding: '16px'
|
|
3420
|
+
},
|
|
3421
|
+
lg: {
|
|
3422
|
+
padding: '24px'
|
|
3423
|
+
}
|
|
3424
|
+
};
|
|
3407
3425
|
/**
|
|
3408
3426
|
* Card shapes with consistent border radius
|
|
3409
3427
|
*/
|
|
3410
3428
|
var CardShapes = {
|
|
3411
3429
|
sharp: 0,
|
|
3412
3430
|
rounded: '8px',
|
|
3413
|
-
pillShaped: '
|
|
3431
|
+
pillShaped: '24px'
|
|
3414
3432
|
};
|
|
3415
3433
|
/**
|
|
3416
3434
|
* Get card variants with consistent styling based on theme mode
|
|
3417
3435
|
*/
|
|
3418
3436
|
var getCardVariants = themeMode => {
|
|
3437
|
+
var isDark = themeMode === 'dark';
|
|
3419
3438
|
return {
|
|
3420
3439
|
default: {
|
|
3421
|
-
backgroundColor: 'color.white',
|
|
3440
|
+
backgroundColor: isDark ? 'color.gray.900' : 'color.white',
|
|
3422
3441
|
border: 'none',
|
|
3423
3442
|
transition: 'background-color 0.2s ease, box-shadow 0.2s ease'
|
|
3424
3443
|
},
|
|
3425
3444
|
outlined: {
|
|
3426
|
-
backgroundColor: 'color.white',
|
|
3445
|
+
backgroundColor: isDark ? 'color.gray.900' : 'color.white',
|
|
3427
3446
|
borderWidth: '1px',
|
|
3428
3447
|
borderStyle: 'solid',
|
|
3429
|
-
borderColor: 'color.gray.200',
|
|
3448
|
+
borderColor: isDark ? 'color.gray.700' : 'color.gray.200',
|
|
3430
3449
|
transition: 'border-color 0.2s ease, box-shadow 0.2s ease',
|
|
3431
3450
|
_hover: {
|
|
3432
|
-
borderColor: 'color.gray.300',
|
|
3451
|
+
borderColor: isDark ? 'color.gray.600' : 'color.gray.300',
|
|
3433
3452
|
boxShadow: '0px 1px 3px rgba(0, 0, 0, 0.05)'
|
|
3434
|
-
},
|
|
3435
|
-
_focusVisible: {
|
|
3436
|
-
outline: 'none',
|
|
3437
|
-
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(0, 0, 0, 0.1)'
|
|
3438
3453
|
}
|
|
3439
3454
|
},
|
|
3440
3455
|
elevated: {
|
|
3441
|
-
backgroundColor: 'color.white',
|
|
3442
|
-
boxShadow: '0px 1px 3px rgba(0, 0, 0, 0.08), 0px 1px 2px rgba(0, 0, 0, 0.06)',
|
|
3456
|
+
backgroundColor: isDark ? 'color.gray.900' : 'color.white',
|
|
3457
|
+
boxShadow: isDark ? '0px 4px 12px rgba(0, 0, 0, 0.3)' : '0px 1px 3px rgba(0, 0, 0, 0.08), 0px 1px 2px rgba(0, 0, 0, 0.06)',
|
|
3443
3458
|
border: 'none',
|
|
3444
3459
|
transition: 'box-shadow 0.2s ease',
|
|
3445
3460
|
_hover: {
|
|
3446
|
-
boxShadow: '0px 4px 6px rgba(0, 0, 0, 0.08), 0px 2px 4px rgba(0, 0, 0, 0.06)'
|
|
3447
|
-
},
|
|
3448
|
-
_focusVisible: {
|
|
3449
|
-
outline: 'none',
|
|
3450
|
-
boxShadow: '0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(0, 0, 0, 0.1), 0px 4px 6px rgba(0, 0, 0, 0.08)'
|
|
3461
|
+
boxShadow: isDark ? '0px 8px 16px rgba(0, 0, 0, 0.4)' : '0px 4px 6px rgba(0, 0, 0, 0.08), 0px 2px 4px rgba(0, 0, 0, 0.06)'
|
|
3451
3462
|
}
|
|
3452
3463
|
}
|
|
3453
3464
|
};
|
|
@@ -3457,50 +3468,31 @@ var getCardVariants = themeMode => {
|
|
|
3457
3468
|
* @param theme - Theme object from useTheme hook
|
|
3458
3469
|
*/
|
|
3459
3470
|
var getDefaultCardStyles = theme => {
|
|
3471
|
+
var isDark = theme.themeMode === 'dark';
|
|
3460
3472
|
return {
|
|
3461
3473
|
container: {
|
|
3462
|
-
backgroundColor: 'color.white',
|
|
3463
|
-
color: 'color.black',
|
|
3474
|
+
backgroundColor: isDark ? 'color.gray.900' : 'color.white',
|
|
3475
|
+
color: isDark ? 'color.white' : 'color.black',
|
|
3464
3476
|
borderRadius: '8px',
|
|
3465
3477
|
overflow: 'hidden',
|
|
3466
|
-
transition: 'all 0.2s ease'
|
|
3467
|
-
media: {
|
|
3468
|
-
mobile: {
|
|
3469
|
-
borderRadius: '4px'
|
|
3470
|
-
}
|
|
3471
|
-
}
|
|
3478
|
+
transition: 'all 0.2s ease'
|
|
3472
3479
|
},
|
|
3473
3480
|
header: {
|
|
3474
3481
|
padding: '16px',
|
|
3475
3482
|
borderBottomWidth: '1px',
|
|
3476
3483
|
borderBottomStyle: 'solid',
|
|
3477
|
-
borderBottomColor: 'color.gray.
|
|
3478
|
-
color: '
|
|
3479
|
-
media: {
|
|
3480
|
-
mobile: {
|
|
3481
|
-
padding: '12px'
|
|
3482
|
-
}
|
|
3483
|
-
}
|
|
3484
|
+
borderBottomColor: isDark ? 'color.gray.800' : 'color.gray.100',
|
|
3485
|
+
color: 'theme.primary'
|
|
3484
3486
|
},
|
|
3485
3487
|
content: {
|
|
3486
3488
|
padding: '16px',
|
|
3487
|
-
color: 'color.
|
|
3488
|
-
media: {
|
|
3489
|
-
mobile: {
|
|
3490
|
-
padding: '12px'
|
|
3491
|
-
}
|
|
3492
|
-
}
|
|
3489
|
+
color: isDark ? 'color.gray.300' : 'color.gray.600'
|
|
3493
3490
|
},
|
|
3494
3491
|
footer: {
|
|
3495
3492
|
padding: '16px',
|
|
3496
3493
|
borderTopWidth: '1px',
|
|
3497
3494
|
borderTopStyle: 'solid',
|
|
3498
|
-
borderTopColor: 'color.gray.
|
|
3499
|
-
media: {
|
|
3500
|
-
mobile: {
|
|
3501
|
-
padding: '12px'
|
|
3502
|
-
}
|
|
3503
|
-
}
|
|
3495
|
+
borderTopColor: isDark ? 'color.gray.800' : 'color.gray.100'
|
|
3504
3496
|
}
|
|
3505
3497
|
};
|
|
3506
3498
|
};
|
|
@@ -3525,12 +3517,14 @@ var CardHeader = _ref => {
|
|
|
3525
3517
|
var {
|
|
3526
3518
|
styles: contextStyles
|
|
3527
3519
|
} = useCardContext();
|
|
3528
|
-
var defaultStyles = getDefaultCardStyles().header;
|
|
3520
|
+
var defaultStyles = getDefaultCardStyles(theme).header;
|
|
3529
3521
|
// Merge styles: Default < Context Override < Direct Props/Style
|
|
3530
3522
|
var mergedProps = Object.assign({}, defaultStyles, contextStyles == null ? void 0 : contextStyles.header, props, {
|
|
3531
3523
|
style: Object.assign({}, defaultStyles == null ? void 0 : defaultStyles.style, contextStyles == null || (_contextStyles$header = contextStyles.header) == null ? void 0 : _contextStyles$header.style, style)
|
|
3532
3524
|
});
|
|
3533
|
-
return /*#__PURE__*/React__default.createElement(appStudio.
|
|
3525
|
+
return /*#__PURE__*/React__default.createElement(appStudio.Vertical, Object.assign({
|
|
3526
|
+
gap: 8
|
|
3527
|
+
}, mergedProps), children);
|
|
3534
3528
|
};
|
|
3535
3529
|
var CardContent = _ref2 => {
|
|
3536
3530
|
var _contextStyles$conten;
|
|
@@ -3543,12 +3537,14 @@ var CardContent = _ref2 => {
|
|
|
3543
3537
|
var {
|
|
3544
3538
|
styles: contextStyles
|
|
3545
3539
|
} = useCardContext();
|
|
3546
|
-
var defaultStyles = getDefaultCardStyles().content;
|
|
3540
|
+
var defaultStyles = getDefaultCardStyles(theme).content;
|
|
3547
3541
|
// Merge styles: Default < Context Override < Direct Props/Style
|
|
3548
3542
|
var mergedProps = Object.assign({}, defaultStyles, contextStyles == null ? void 0 : contextStyles.content, props, {
|
|
3549
3543
|
style: Object.assign({}, defaultStyles == null ? void 0 : defaultStyles.style, contextStyles == null || (_contextStyles$conten = contextStyles.content) == null ? void 0 : _contextStyles$conten.style, style)
|
|
3550
3544
|
});
|
|
3551
|
-
return /*#__PURE__*/React__default.createElement(appStudio.
|
|
3545
|
+
return /*#__PURE__*/React__default.createElement(appStudio.Vertical, Object.assign({
|
|
3546
|
+
gap: 12
|
|
3547
|
+
}, mergedProps), children);
|
|
3552
3548
|
};
|
|
3553
3549
|
var CardFooter = _ref3 => {
|
|
3554
3550
|
var _contextStyles$footer;
|
|
@@ -3561,15 +3557,17 @@ var CardFooter = _ref3 => {
|
|
|
3561
3557
|
var {
|
|
3562
3558
|
styles: contextStyles
|
|
3563
3559
|
} = useCardContext();
|
|
3564
|
-
var defaultStyles = getDefaultCardStyles().footer;
|
|
3560
|
+
var defaultStyles = getDefaultCardStyles(theme).footer;
|
|
3565
3561
|
// Merge styles: Default < Context Override < Direct Props/Style
|
|
3566
3562
|
var mergedProps = Object.assign({}, defaultStyles, contextStyles == null ? void 0 : contextStyles.footer, props, {
|
|
3567
3563
|
style: Object.assign({}, defaultStyles == null ? void 0 : defaultStyles.style, contextStyles == null || (_contextStyles$footer = contextStyles.footer) == null ? void 0 : _contextStyles$footer.style, style)
|
|
3568
3564
|
});
|
|
3569
|
-
return /*#__PURE__*/React__default.createElement(appStudio.
|
|
3565
|
+
return /*#__PURE__*/React__default.createElement(appStudio.Vertical, Object.assign({
|
|
3566
|
+
gap: 8
|
|
3567
|
+
}, mergedProps), children);
|
|
3570
3568
|
};
|
|
3571
3569
|
var CardView = _ref4 => {
|
|
3572
|
-
var _contextValue$styles$;
|
|
3570
|
+
var _CardSizes$size, _contextValue$styles$;
|
|
3573
3571
|
var {
|
|
3574
3572
|
variant = 'default',
|
|
3575
3573
|
size = 'md',
|
|
@@ -3584,20 +3582,32 @@ var CardView = _ref4 => {
|
|
|
3584
3582
|
} = _ref4,
|
|
3585
3583
|
props = _objectWithoutPropertiesLoose(_ref4, _excluded4$3);
|
|
3586
3584
|
var theme = appStudio.useTheme();
|
|
3587
|
-
var defaultStyles = getDefaultCardStyles();
|
|
3585
|
+
var defaultStyles = getDefaultCardStyles(theme);
|
|
3586
|
+
// Get size padding
|
|
3587
|
+
var sizePadding = ((_CardSizes$size = CardSizes[size]) == null ? void 0 : _CardSizes$size.padding) || '16px';
|
|
3588
3588
|
// Prepare context value, merging default styles with user's `views` overrides
|
|
3589
3589
|
var contextValue = React.useMemo(() => ({
|
|
3590
3590
|
styles: {
|
|
3591
3591
|
container: Object.assign({}, defaultStyles.container, views == null ? void 0 : views.container),
|
|
3592
|
-
header: Object.assign({}, defaultStyles.header,
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3592
|
+
header: Object.assign({}, defaultStyles.header, {
|
|
3593
|
+
padding: sizePadding
|
|
3594
|
+
}, views == null ? void 0 : views.header),
|
|
3595
|
+
content: Object.assign({}, defaultStyles.content, {
|
|
3596
|
+
padding: sizePadding
|
|
3597
|
+
}, views == null ? void 0 : views.content),
|
|
3598
|
+
footer: Object.assign({}, defaultStyles.footer, {
|
|
3599
|
+
padding: sizePadding
|
|
3600
|
+
}, views == null ? void 0 : views.footer)
|
|
3601
|
+
}
|
|
3602
|
+
}), [defaultStyles, views, sizePadding]);
|
|
3597
3603
|
// Determine if we have explicit Card.Header, Card.Content, Card.Footer components
|
|
3598
|
-
// or if we need to wrap children in a default layout
|
|
3599
3604
|
var hasExplicitStructure = React__default.Children.toArray(children).some(child => /*#__PURE__*/React__default.isValidElement(child) && (child.type === CardHeader || child.type === CardContent || child.type === CardFooter));
|
|
3600
|
-
|
|
3605
|
+
// Get the appropriate variant styles based on theme mode
|
|
3606
|
+
var {
|
|
3607
|
+
themeMode
|
|
3608
|
+
} = theme;
|
|
3609
|
+
var currentThemeMode = elementMode || themeMode;
|
|
3610
|
+
var variantStyles = getCardVariants(currentThemeMode)[variant];
|
|
3601
3611
|
// Merge styles for the root element
|
|
3602
3612
|
var mergedRootProps = Object.assign({
|
|
3603
3613
|
width: isFullWidth ? '100%' : 'auto',
|
|
@@ -3608,7 +3618,9 @@ var CardView = _ref4 => {
|
|
|
3608
3618
|
});
|
|
3609
3619
|
return /*#__PURE__*/React__default.createElement(CardContext.Provider, {
|
|
3610
3620
|
value: contextValue
|
|
3611
|
-
}, /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, mergedRootProps), hasExplicitStructure ? children : (/*#__PURE__*/React__default.createElement(appStudio.Vertical,
|
|
3621
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, mergedRootProps), hasExplicitStructure ? children : (/*#__PURE__*/React__default.createElement(appStudio.Vertical, {
|
|
3622
|
+
width: "100%"
|
|
3623
|
+
}, header && /*#__PURE__*/React__default.createElement(CardHeader, null, header), /*#__PURE__*/React__default.createElement(CardContent, null, children), footer && /*#__PURE__*/React__default.createElement(CardFooter, null, footer)))));
|
|
3612
3624
|
};
|
|
3613
3625
|
|
|
3614
3626
|
/**
|
|
@@ -7344,12 +7356,9 @@ var ColorSchemes = {
|
|
|
7344
7356
|
// State-specific colors
|
|
7345
7357
|
states: {
|
|
7346
7358
|
hover: {
|
|
7347
|
-
active:
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
inactive: {
|
|
7351
|
-
backgroundColor: 'color.gray.400'
|
|
7352
|
-
}
|
|
7359
|
+
active: 'theme.primary',
|
|
7360
|
+
inactive: 'color.gray.400',
|
|
7361
|
+
activeOpacity: 0.9
|
|
7353
7362
|
},
|
|
7354
7363
|
focus: {
|
|
7355
7364
|
active: {
|
|
@@ -7363,6 +7372,17 @@ var ColorSchemes = {
|
|
|
7363
7372
|
}
|
|
7364
7373
|
}
|
|
7365
7374
|
};
|
|
7375
|
+
/**
|
|
7376
|
+
* Transition styles for the Switch component
|
|
7377
|
+
*/
|
|
7378
|
+
var TransitionStyles = {
|
|
7379
|
+
slider: {
|
|
7380
|
+
transition: 'all 0.3s cubic-bezier(0.4, 0, 0.2, 1)'
|
|
7381
|
+
},
|
|
7382
|
+
knob: {
|
|
7383
|
+
transition: 'all 0.3s cubic-bezier(0.4, 0, 0.2, 1)'
|
|
7384
|
+
}
|
|
7385
|
+
};
|
|
7366
7386
|
|
|
7367
7387
|
var _excluded$t = ["id", "name", "label", "inActiveChild", "isChecked", "activeChild", "labelPosition", "shadow", "size", "value", "isHovered", "isDisabled", "isReadOnly", "on", "setOn", "onChange", "setValue", "setIsHovered", "helperText", "views"];
|
|
7368
7388
|
var SwitchContent = props => /*#__PURE__*/React__default.createElement(appStudio.Input, Object.assign({
|
|
@@ -7401,7 +7421,8 @@ var SwitchView = _ref => {
|
|
|
7401
7421
|
if (onChange) onChange(newValue);
|
|
7402
7422
|
}
|
|
7403
7423
|
};
|
|
7404
|
-
var
|
|
7424
|
+
var handleMouseEnter = () => setIsHovered(true);
|
|
7425
|
+
var handleMouseLeave = () => setIsHovered(false);
|
|
7405
7426
|
/**
|
|
7406
7427
|
* Styles for the switch component
|
|
7407
7428
|
*/
|
|
@@ -7423,8 +7444,8 @@ var SwitchView = _ref => {
|
|
|
7423
7444
|
};
|
|
7424
7445
|
return /*#__PURE__*/React__default.createElement(Label, Object.assign({
|
|
7425
7446
|
htmlFor: id,
|
|
7426
|
-
onMouseEnter:
|
|
7427
|
-
onMouseLeave:
|
|
7447
|
+
onMouseEnter: handleMouseEnter,
|
|
7448
|
+
onMouseLeave: handleMouseLeave
|
|
7428
7449
|
}, switchStyle.container, props), /*#__PURE__*/React__default.createElement(SwitchContent, Object.assign({
|
|
7429
7450
|
id: id,
|
|
7430
7451
|
name: name,
|
|
@@ -7452,12 +7473,10 @@ var SwitchView = _ref => {
|
|
|
7452
7473
|
borderRadius: "9999px" // Full rounded for pill shape
|
|
7453
7474
|
,
|
|
7454
7475
|
backgroundColor: isDisabled ? ColorSchemes.default.disabled : value ? isHovered ? ColorSchemes.states.hover.active : ColorSchemes.default.active : isHovered ? ColorSchemes.states.hover.inactive : ColorSchemes.default.inactive,
|
|
7455
|
-
|
|
7476
|
+
opacity: !isDisabled && value && isHovered ? ColorSchemes.states.hover.activeOpacity : 1,
|
|
7456
7477
|
// State properties
|
|
7457
|
-
cursor: "pointer"
|
|
7458
|
-
|
|
7459
|
-
transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"
|
|
7460
|
-
}, shadow, SliderPadding[size], SliderSizes[size], views['slider']), activeChild && value && (/*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7478
|
+
cursor: "pointer"
|
|
7479
|
+
}, TransitionStyles.slider, shadow, SliderPadding[size], SliderSizes[size], views['slider']), activeChild && value && (/*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7461
7480
|
marginLeft: 8,
|
|
7462
7481
|
marginRight: 4,
|
|
7463
7482
|
transition: "all 0.3s ease",
|
|
@@ -7468,8 +7487,9 @@ var SwitchView = _ref => {
|
|
|
7468
7487
|
}, activeChild)), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
7469
7488
|
borderRadius: "50%",
|
|
7470
7489
|
backgroundColor: ColorSchemes.default.knob,
|
|
7471
|
-
boxShadow:
|
|
7472
|
-
|
|
7490
|
+
boxShadow: isHovered ? '0 2px 4px rgba(0, 0, 0, 0.2)' : '0 1px 2px rgba(0, 0, 0, 0.1)',
|
|
7491
|
+
transform: isHovered ? 'scale(1.05)' : 'scale(1)'
|
|
7492
|
+
}, TransitionStyles.knob, {
|
|
7473
7493
|
zIndex: 1
|
|
7474
7494
|
}, KnobSizes[size], views['circle'])), inActiveChild && !value && (/*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
7475
7495
|
marginRight: 8,
|
|
@@ -11281,29 +11301,32 @@ var TagChip = _ref => {
|
|
|
11281
11301
|
alignItems: "center",
|
|
11282
11302
|
gap: 6,
|
|
11283
11303
|
padding: chipSize.padding,
|
|
11284
|
-
backgroundColor: "
|
|
11304
|
+
backgroundColor: "color.gray.100",
|
|
11285
11305
|
borderRadius: "16px",
|
|
11286
|
-
|
|
11287
|
-
|
|
11306
|
+
borderWidth: "1px",
|
|
11307
|
+
borderStyle: "solid",
|
|
11308
|
+
borderColor: "color.gray.300",
|
|
11288
11309
|
boxShadow: "0 1px 2px rgba(0,0,0,0.05)",
|
|
11289
11310
|
transition: "all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
11290
11311
|
opacity: isDisabled ? 0.6 : 1,
|
|
11291
11312
|
_hover: !isDisabled && !isReadOnly ? {
|
|
11292
|
-
|
|
11313
|
+
backgroundColor: 'color.gray.200',
|
|
11314
|
+
borderColor: 'color.gray.400',
|
|
11293
11315
|
boxShadow: '0 4px 6px rgba(0,0,0,0.05)',
|
|
11294
11316
|
transform: 'translateY(-1px)'
|
|
11295
11317
|
} : {}
|
|
11296
11318
|
}, views == null ? void 0 : views.tag), /*#__PURE__*/React__default.createElement(appStudio.Text, Object.assign({
|
|
11297
11319
|
fontSize: chipSize.fontSize,
|
|
11298
|
-
color: isDisabled ? 'color.gray.400' : '
|
|
11299
|
-
fontWeight: "
|
|
11320
|
+
color: isDisabled ? 'color.gray.400' : 'theme.primary',
|
|
11321
|
+
fontWeight: "bold",
|
|
11300
11322
|
whiteSpace: "nowrap"
|
|
11301
11323
|
}, views == null ? void 0 : views.tagText), tag), isRemovable && !isDisabled && !isReadOnly && (/*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
11302
11324
|
cursor: "pointer",
|
|
11303
11325
|
padding: "2px",
|
|
11304
11326
|
borderRadius: "50%",
|
|
11305
11327
|
transition: "all 0.2s ease",
|
|
11306
|
-
backgroundColor: isRemoveHovered ? 'color.red.
|
|
11328
|
+
backgroundColor: isRemoveHovered ? 'color.red.100' : 'transparent',
|
|
11329
|
+
opacity: isRemoveHovered ? 1 : 0.7,
|
|
11307
11330
|
onMouseEnter: () => setIsRemoveHovered(true),
|
|
11308
11331
|
onMouseLeave: () => setIsRemoveHovered(false),
|
|
11309
11332
|
onClick: e => {
|
|
@@ -11370,7 +11393,7 @@ var TagInputView = _ref2 => {
|
|
|
11370
11393
|
outline: 'none',
|
|
11371
11394
|
backgroundColor: 'transparent',
|
|
11372
11395
|
fontSize: appStudio.Typography.fontSizes[size],
|
|
11373
|
-
color: isDisabled ? 'color.gray.400' : 'color.gray.
|
|
11396
|
+
color: isDisabled ? 'color.gray.400' : 'color.gray.800',
|
|
11374
11397
|
flex: 1,
|
|
11375
11398
|
minWidth: '120px'
|
|
11376
11399
|
}, views == null ? void 0 : views.input);
|