@mindlogic-ai/logician-ui 4.0.0-alpha.33 → 4.0.0-alpha.35
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/Card/Card.d.ts.map +1 -1
- package/dist/components/Card/Card.js +2 -1
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Card/Card.mjs +2 -1
- package/dist/components/Card/Card.mjs.map +1 -1
- package/dist/components/Card/Card.styles.d.ts +22 -3
- package/dist/components/Card/Card.styles.d.ts.map +1 -1
- package/dist/components/Card/Card.styles.js +29 -6
- package/dist/components/Card/Card.styles.js.map +1 -1
- package/dist/components/Card/Card.styles.mjs +29 -6
- package/dist/components/Card/Card.styles.mjs.map +1 -1
- package/dist/components/Card/Card.types.d.ts +5 -1
- package/dist/components/Card/Card.types.d.ts.map +1 -1
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/Modal.js.map +1 -1
- package/dist/components/Modal/Modal.mjs +1 -1
- package/dist/components/Modal/Modal.mjs.map +1 -1
- package/dist/components/Modal/Modal.types.d.ts +10 -2
- package/dist/components/Modal/Modal.types.d.ts.map +1 -1
- package/dist/components/Modal/ModalContext.js +1 -1
- package/dist/components/Modal/ModalContext.js.map +1 -1
- package/dist/components/Modal/ModalContext.mjs +1 -1
- package/dist/components/Modal/ModalContext.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/Card/Card.stories.tsx +3 -3
- package/src/components/Card/Card.styles.ts +30 -6
- package/src/components/Card/Card.tsx +2 -1
- package/src/components/Card/Card.types.ts +5 -1
- package/src/components/Modal/Modal.stories.tsx +7 -6
- package/src/components/Modal/Modal.tsx +1 -1
- package/src/components/Modal/Modal.types.ts +10 -2
- package/src/components/Modal/ModalContext.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAyC5C,eAAO,MAAM,IAAI,2DAA6C,CAAC"}
|
|
@@ -15,7 +15,8 @@ const CardImpl = React.forwardRef(({ clickable, variant = 'default', _hover, ...
|
|
|
15
15
|
// border.default (gray.300 / gray.1100 _dark) instead of border.subtle:
|
|
16
16
|
// subtle's _dark (gray.1300 #1E2433) is ~invisible on bg.surface in dark,
|
|
17
17
|
// so cards blended into the canvas. default gives the card a discernible
|
|
18
|
-
// edge in both modes. The `
|
|
18
|
+
// edge in both modes. The `wash` variant softens it back to
|
|
19
|
+
// border.subtle because its `bg.subtle` fill already separates it.
|
|
19
20
|
borderColor: "border.default", borderRadius: "lg",
|
|
20
21
|
// Was `transitionDuration="normal"` — a Chakra v2 token absent from v3.
|
|
21
22
|
// It fell through as a literal, `transition-duration: normal` is invalid
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":[null],"names":["forwardRef","clickableStyles","_jsx","ChakraCard","variantStyles","polymorphic"],"mappings":";;;;;;;;;AAOA,MAAM,QAAQ,GAAGA,gBAAU,CACzB,CAAC,EAAE,SAAS,EAAE,OAAO,GAAG,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,KAAI;IAC3D,MAAM,WAAW,GAAG;UAChB,EAAE,GAAGC,2BAAe,CAAC,MAAM,EAAE,GAAG,MAAM;UACtC,MAAM;AAEV,IAAA,QACEC,cAAA,CAACC,UAAU,CAAC,IAAI,EAAA,EACd,GAAG,EAAE,GAAG,EACR,QAAQ,EAAC,UAAU,EACnB,EAAE,EAAC,YAAY,EACf,KAAK,EAAC,YAAY,EAClB,SAAS,EAAC,MAAM,EAChB,MAAM,EAAC,WAAW
|
|
1
|
+
{"version":3,"file":"Card.js","sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":[null],"names":["forwardRef","clickableStyles","_jsx","ChakraCard","variantStyles","polymorphic"],"mappings":";;;;;;;;;AAOA,MAAM,QAAQ,GAAGA,gBAAU,CACzB,CAAC,EAAE,SAAS,EAAE,OAAO,GAAG,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,KAAI;IAC3D,MAAM,WAAW,GAAG;UAChB,EAAE,GAAGC,2BAAe,CAAC,MAAM,EAAE,GAAG,MAAM;UACtC,MAAM;AAEV,IAAA,QACEC,cAAA,CAACC,UAAU,CAAC,IAAI,EAAA,EACd,GAAG,EAAE,GAAG,EACR,QAAQ,EAAC,UAAU,EACnB,EAAE,EAAC,YAAY,EACf,KAAK,EAAC,YAAY,EAClB,SAAS,EAAC,MAAM,EAChB,MAAM,EAAC,WAAW;;;;;;AAMlB,QAAA,WAAW,EAAC,gBAAgB,EAC5B,YAAY,EAAC,IAAI;;;;AAIjB,QAAA,cAAc,EAAC,UAAU,EACzB,kBAAkB,EAAC,QAAQ,EAC3B,CAAC,EAAE,CAAC,EAAA,IACC,SAAS,GAAG,EAAE,MAAM,EAAEF,2BAAe,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,KACrDG,yBAAa,CAAC,OAAO,CAAC,EAAA,GACtB,IAAI,EACR,MAAM,EAAE,WAAW,EAAA,CACnB;AAEN,CAAC,CACF;AAED;AACA,QAAQ,CAAC,WAAW,GAAG,MAAM;MAEhB,IAAI,GAAGC,uBAAW,CAAsB,QAAQ;;;;"}
|
|
@@ -13,7 +13,8 @@ const CardImpl = forwardRef(({ clickable, variant = 'default', _hover, ...rest }
|
|
|
13
13
|
// border.default (gray.300 / gray.1100 _dark) instead of border.subtle:
|
|
14
14
|
// subtle's _dark (gray.1300 #1E2433) is ~invisible on bg.surface in dark,
|
|
15
15
|
// so cards blended into the canvas. default gives the card a discernible
|
|
16
|
-
// edge in both modes. The `
|
|
16
|
+
// edge in both modes. The `wash` variant softens it back to
|
|
17
|
+
// border.subtle because its `bg.subtle` fill already separates it.
|
|
17
18
|
borderColor: "border.default", borderRadius: "lg",
|
|
18
19
|
// Was `transitionDuration="normal"` — a Chakra v2 token absent from v3.
|
|
19
20
|
// It fell through as a literal, `transition-duration: normal` is invalid
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.mjs","sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":[null],"names":["_jsx","ChakraCard"],"mappings":";;;;;;;AAOA,MAAM,QAAQ,GAAG,UAAU,CACzB,CAAC,EAAE,SAAS,EAAE,OAAO,GAAG,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,KAAI;IAC3D,MAAM,WAAW,GAAG;UAChB,EAAE,GAAG,eAAe,CAAC,MAAM,EAAE,GAAG,MAAM;UACtC,MAAM;AAEV,IAAA,QACEA,GAAA,CAACC,MAAU,CAAC,IAAI,EAAA,EACd,GAAG,EAAE,GAAG,EACR,QAAQ,EAAC,UAAU,EACnB,EAAE,EAAC,YAAY,EACf,KAAK,EAAC,YAAY,EAClB,SAAS,EAAC,MAAM,EAChB,MAAM,EAAC,WAAW
|
|
1
|
+
{"version":3,"file":"Card.mjs","sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":[null],"names":["_jsx","ChakraCard"],"mappings":";;;;;;;AAOA,MAAM,QAAQ,GAAG,UAAU,CACzB,CAAC,EAAE,SAAS,EAAE,OAAO,GAAG,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,KAAI;IAC3D,MAAM,WAAW,GAAG;UAChB,EAAE,GAAG,eAAe,CAAC,MAAM,EAAE,GAAG,MAAM;UACtC,MAAM;AAEV,IAAA,QACEA,GAAA,CAACC,MAAU,CAAC,IAAI,EAAA,EACd,GAAG,EAAE,GAAG,EACR,QAAQ,EAAC,UAAU,EACnB,EAAE,EAAC,YAAY,EACf,KAAK,EAAC,YAAY,EAClB,SAAS,EAAC,MAAM,EAChB,MAAM,EAAC,WAAW;;;;;;AAMlB,QAAA,WAAW,EAAC,gBAAgB,EAC5B,YAAY,EAAC,IAAI;;;;AAIjB,QAAA,cAAc,EAAC,UAAU,EACzB,kBAAkB,EAAC,QAAQ,EAC3B,CAAC,EAAE,CAAC,EAAA,IACC,SAAS,GAAG,EAAE,MAAM,EAAE,eAAe,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,KACrD,aAAa,CAAC,OAAO,CAAC,EAAA,GACtB,IAAI,EACR,MAAM,EAAE,WAAW,EAAA,CACnB;AAEN,CAAC,CACF;AAED;AACA,QAAQ,CAAC,WAAW,GAAG,MAAM;MAEhB,IAAI,GAAG,WAAW,CAAsB,QAAQ;;;;"}
|
|
@@ -1,17 +1,36 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Card styles using the Golden Ratio color system.
|
|
3
3
|
*/
|
|
4
|
+
/**
|
|
5
|
+
* The clickable hover is flat: the ground steps one tier to `bg.subtle` and
|
|
6
|
+
* the border darkens to `border.strong`. Nothing lifts and nothing grows a
|
|
7
|
+
* shadow. A raised hover said "this floats", and a card in a list does not;
|
|
8
|
+
* the tier step and the border say "this is the one under the pointer" with
|
|
9
|
+
* no elevation, and both tokens invert, so the state reads in dark mode where
|
|
10
|
+
* a neutral tint would vanish.
|
|
11
|
+
*/
|
|
4
12
|
export declare const clickableStyles: {
|
|
5
13
|
cursor: string;
|
|
6
14
|
_hover: {
|
|
7
|
-
|
|
15
|
+
bg: string;
|
|
16
|
+
borderColor: string;
|
|
8
17
|
};
|
|
9
18
|
};
|
|
10
19
|
export declare const variantStyles: {
|
|
11
20
|
default: {};
|
|
21
|
+
wash: {
|
|
22
|
+
bg: {
|
|
23
|
+
base: string;
|
|
24
|
+
_dark: string;
|
|
25
|
+
};
|
|
26
|
+
borderColor: string;
|
|
27
|
+
};
|
|
28
|
+
/** @deprecated Renders as `wash`; use `variant="wash"`. */
|
|
12
29
|
gradient: {
|
|
13
|
-
bg:
|
|
14
|
-
|
|
30
|
+
bg: {
|
|
31
|
+
base: string;
|
|
32
|
+
_dark: string;
|
|
33
|
+
};
|
|
15
34
|
borderColor: string;
|
|
16
35
|
};
|
|
17
36
|
elevated: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.styles.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"Card.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.styles.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe;;;;;;CAM3B,CAAC;AAmBF,eAAO,MAAM,aAAa;;;;;;;;;IAGxB,2DAA2D;;;;;;;;;;;;CAU5D,CAAC"}
|
|
@@ -4,19 +4,42 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* Card styles using the Golden Ratio color system.
|
|
6
6
|
*/
|
|
7
|
+
/**
|
|
8
|
+
* The clickable hover is flat: the ground steps one tier to `bg.subtle` and
|
|
9
|
+
* the border darkens to `border.strong`. Nothing lifts and nothing grows a
|
|
10
|
+
* shadow. A raised hover said "this floats", and a card in a list does not;
|
|
11
|
+
* the tier step and the border say "this is the one under the pointer" with
|
|
12
|
+
* no elevation, and both tokens invert, so the state reads in dark mode where
|
|
13
|
+
* a neutral tint would vanish.
|
|
14
|
+
*/
|
|
7
15
|
const clickableStyles = {
|
|
8
16
|
cursor: 'pointer',
|
|
9
17
|
_hover: {
|
|
10
|
-
|
|
18
|
+
bg: 'bg.subtle',
|
|
19
|
+
borderColor: 'border.strong',
|
|
11
20
|
},
|
|
12
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* The wash card: one tier off the page with a hairline. For a block that
|
|
24
|
+
* summarises or concludes (an AI summary, a total after a purchase, the
|
|
25
|
+
* invitation being accepted). It is what `gradient` used to paint with a
|
|
26
|
+
* 180deg wash and a brand-tinted border; the gradient read as decoration and
|
|
27
|
+
* the tinted border claimed brand for a surface that is not an action.
|
|
28
|
+
*
|
|
29
|
+
* The tier is `bg.subtle` in light but `bg.muted` in dark: `bg.subtle` sits
|
|
30
|
+
* one grayDark step above `bg.surface` there, too close to read as a different
|
|
31
|
+
* surface, and `border.subtle` resolves to the same step, so the hairline would
|
|
32
|
+
* vanish. `border.default` keeps the edge in both modes.
|
|
33
|
+
*/
|
|
34
|
+
const washStyles = {
|
|
35
|
+
bg: { base: 'bg.subtle', _dark: 'bg.muted' },
|
|
36
|
+
borderColor: 'border.default',
|
|
37
|
+
};
|
|
13
38
|
const variantStyles = {
|
|
14
39
|
default: {},
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
borderColor: 'primary.light',
|
|
19
|
-
},
|
|
40
|
+
wash: washStyles,
|
|
41
|
+
/** @deprecated Renders as `wash`; use `variant="wash"`. */
|
|
42
|
+
gradient: washStyles,
|
|
20
43
|
// Soft resting elevation — a gentle shadow does the separating, so the border
|
|
21
44
|
// can soften to `border.subtle` (which alone would be too faint, especially in
|
|
22
45
|
// dark mode). Use for standalone content cards that should read as raised
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.styles.js","sources":["../../../src/components/Card/Card.styles.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAAA;;AAEG;
|
|
1
|
+
{"version":3,"file":"Card.styles.js","sources":["../../../src/components/Card/Card.styles.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAAA;;AAEG;AAEH;;;;;;;AAOG;AACI,MAAM,eAAe,GAAG;AAC7B,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,MAAM,EAAE;AACN,QAAA,EAAE,EAAE,WAAW;AACf,QAAA,WAAW,EAAE,eAAe;AAC7B,KAAA;;AAGH;;;;;;;;;;;AAWG;AACH,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,EAAE;AAC5C,IAAA,WAAW,EAAE,gBAAgB;CAC9B;AAEM,MAAM,aAAa,GAAG;AAC3B,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,IAAI,EAAE,UAAU;;AAEhB,IAAA,QAAQ,EAAE,UAAU;;;;;AAKpB,IAAA,QAAQ,EAAE;AACR,QAAA,SAAS,EAAE,IAAI;AACf,QAAA,WAAW,EAAE,eAAe;AAC7B,KAAA;;;;;;"}
|
|
@@ -2,19 +2,42 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Card styles using the Golden Ratio color system.
|
|
4
4
|
*/
|
|
5
|
+
/**
|
|
6
|
+
* The clickable hover is flat: the ground steps one tier to `bg.subtle` and
|
|
7
|
+
* the border darkens to `border.strong`. Nothing lifts and nothing grows a
|
|
8
|
+
* shadow. A raised hover said "this floats", and a card in a list does not;
|
|
9
|
+
* the tier step and the border say "this is the one under the pointer" with
|
|
10
|
+
* no elevation, and both tokens invert, so the state reads in dark mode where
|
|
11
|
+
* a neutral tint would vanish.
|
|
12
|
+
*/
|
|
5
13
|
const clickableStyles = {
|
|
6
14
|
cursor: 'pointer',
|
|
7
15
|
_hover: {
|
|
8
|
-
|
|
16
|
+
bg: 'bg.subtle',
|
|
17
|
+
borderColor: 'border.strong',
|
|
9
18
|
},
|
|
10
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* The wash card: one tier off the page with a hairline. For a block that
|
|
22
|
+
* summarises or concludes (an AI summary, a total after a purchase, the
|
|
23
|
+
* invitation being accepted). It is what `gradient` used to paint with a
|
|
24
|
+
* 180deg wash and a brand-tinted border; the gradient read as decoration and
|
|
25
|
+
* the tinted border claimed brand for a surface that is not an action.
|
|
26
|
+
*
|
|
27
|
+
* The tier is `bg.subtle` in light but `bg.muted` in dark: `bg.subtle` sits
|
|
28
|
+
* one grayDark step above `bg.surface` there, too close to read as a different
|
|
29
|
+
* surface, and `border.subtle` resolves to the same step, so the hairline would
|
|
30
|
+
* vanish. `border.default` keeps the edge in both modes.
|
|
31
|
+
*/
|
|
32
|
+
const washStyles = {
|
|
33
|
+
bg: { base: 'bg.subtle', _dark: 'bg.muted' },
|
|
34
|
+
borderColor: 'border.default',
|
|
35
|
+
};
|
|
11
36
|
const variantStyles = {
|
|
12
37
|
default: {},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
borderColor: 'primary.light',
|
|
17
|
-
},
|
|
38
|
+
wash: washStyles,
|
|
39
|
+
/** @deprecated Renders as `wash`; use `variant="wash"`. */
|
|
40
|
+
gradient: washStyles,
|
|
18
41
|
// Soft resting elevation — a gentle shadow does the separating, so the border
|
|
19
42
|
// can soften to `border.subtle` (which alone would be too faint, especially in
|
|
20
43
|
// dark mode). Use for standalone content cards that should read as raised
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.styles.mjs","sources":["../../../src/components/Card/Card.styles.ts"],"sourcesContent":[null],"names":[],"mappings":";AAAA;;AAEG;
|
|
1
|
+
{"version":3,"file":"Card.styles.mjs","sources":["../../../src/components/Card/Card.styles.ts"],"sourcesContent":[null],"names":[],"mappings":";AAAA;;AAEG;AAEH;;;;;;;AAOG;AACI,MAAM,eAAe,GAAG;AAC7B,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,MAAM,EAAE;AACN,QAAA,EAAE,EAAE,WAAW;AACf,QAAA,WAAW,EAAE,eAAe;AAC7B,KAAA;;AAGH;;;;;;;;;;;AAWG;AACH,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,EAAE;AAC5C,IAAA,WAAW,EAAE,gBAAgB;CAC9B;AAEM,MAAM,aAAa,GAAG;AAC3B,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,IAAI,EAAE,UAAU;;AAEhB,IAAA,QAAQ,EAAE,UAAU;;;;;AAKpB,IAAA,QAAQ,EAAE;AACR,QAAA,SAAS,EAAE,IAAI;AACf,QAAA,WAAW,EAAE,eAAe;AAC7B,KAAA;;;;;"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { ElementType } from 'react';
|
|
2
2
|
import { CardRootProps as ChakraCardRootProps } from '@chakra-ui/react';
|
|
3
3
|
import type { PolymorphicProps } from '../../types/polymorphic';
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* `gradient` is a deprecated alias of `wash` and renders identically; it stays
|
|
6
|
+
* so consumers on the alpha line keep compiling while they migrate.
|
|
7
|
+
*/
|
|
8
|
+
export type CardVariant = 'default' | 'wash' | 'gradient' | 'elevated';
|
|
5
9
|
export type CardOwnProps = Omit<ChakraCardRootProps, 'as'> & {
|
|
6
10
|
clickable?: boolean;
|
|
7
11
|
variant?: CardVariant;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.types.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,aAAa,IAAI,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAGxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"Card.types.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,aAAa,IAAI,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAGxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;AAEvE,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,mBAAmB,EAAE,IAAI,CAAC,GAAG;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,SAAS,CAAC,QAAQ,SAAS,WAAW,GAAG,KAAK,IAAI,gBAAgB,CAC5E,QAAQ,EACR,YAAY,CACb,CAAC"}
|
|
@@ -6,7 +6,7 @@ var React = require('react');
|
|
|
6
6
|
var react = require('@chakra-ui/react');
|
|
7
7
|
var ModalContext = require('./ModalContext.js');
|
|
8
8
|
|
|
9
|
-
const Modal = ({ children, open, onOpenChange, portalProps, fullScreenOnMobile =
|
|
9
|
+
const Modal = ({ children, open, onOpenChange, portalProps, fullScreenOnMobile = false, ...rest }) => {
|
|
10
10
|
const ctx = React.useMemo(() => ({ fullScreenOnMobile }), [fullScreenOnMobile]);
|
|
11
11
|
return (jsxRuntime.jsx(react.Dialog.Root, { open: open, onOpenChange: onOpenChange, placement: "center", closeOnInteractOutside: true, ...rest, children: jsxRuntime.jsxs(react.Portal, { ...portalProps, children: [jsxRuntime.jsx(react.Dialog.Backdrop, { _open: { animationDuration: 'motion.base' }, _closed: { animationDuration: 'fast' } }), jsxRuntime.jsx(ModalContext.ModalContext.Provider, { value: ctx, children: children })] }) }));
|
|
12
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sources":["../../../src/components/Modal/Modal.tsx"],"sourcesContent":[null],"names":["useMemo","_jsx","Dialog","_jsxs","Portal","ModalContext"],"mappings":";;;;;;;;MAMa,KAAK,GAAG,CAAC,EACpB,QAAQ,EACR,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,kBAAkB,GAAG,
|
|
1
|
+
{"version":3,"file":"Modal.js","sources":["../../../src/components/Modal/Modal.tsx"],"sourcesContent":[null],"names":["useMemo","_jsx","Dialog","_jsxs","Portal","ModalContext"],"mappings":";;;;;;;;MAMa,KAAK,GAAG,CAAC,EACpB,QAAQ,EACR,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,kBAAkB,GAAG,KAAK,EAC1B,GAAG,IAAI,EACI,KAAI;AACf,IAAA,MAAM,GAAG,GAAGA,aAAO,CAAC,OAAO,EAAE,kBAAkB,EAAE,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC;AAEzE,IAAA,QACEC,cAAA,CAACC,YAAM,CAAC,IAAI,EAAA,EACV,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAC,QAAQ,EAClB,sBAAsB,EAAA,IAAA,EAAA,GAClB,IAAI,EAAA,QAAA,EAERC,eAAA,CAACC,YAAM,EAAA,EAAA,GAAK,WAAW,EAAA,QAAA,EAAA,CAIrBH,cAAA,CAACC,YAAM,CAAC,QAAQ,EAAA,EACd,KAAK,EAAE,EAAE,iBAAiB,EAAE,aAAa,EAAE,EAC3C,OAAO,EAAE,EAAE,iBAAiB,EAAE,MAAM,EAAE,EAAA,CACtC,EACFD,cAAA,CAACI,yBAAY,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,GAAG,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAyB,CAAA,EAAA,CAC9D,EAAA,CACG;AAElB;;;;"}
|
|
@@ -4,7 +4,7 @@ import { useMemo } from 'react';
|
|
|
4
4
|
import { Dialog, Portal } from '@chakra-ui/react';
|
|
5
5
|
import { ModalContext } from './ModalContext.mjs';
|
|
6
6
|
|
|
7
|
-
const Modal = ({ children, open, onOpenChange, portalProps, fullScreenOnMobile =
|
|
7
|
+
const Modal = ({ children, open, onOpenChange, portalProps, fullScreenOnMobile = false, ...rest }) => {
|
|
8
8
|
const ctx = useMemo(() => ({ fullScreenOnMobile }), [fullScreenOnMobile]);
|
|
9
9
|
return (jsx(Dialog.Root, { open: open, onOpenChange: onOpenChange, placement: "center", closeOnInteractOutside: true, ...rest, children: jsxs(Portal, { ...portalProps, children: [jsx(Dialog.Backdrop, { _open: { animationDuration: 'motion.base' }, _closed: { animationDuration: 'fast' } }), jsx(ModalContext.Provider, { value: ctx, children: children })] }) }));
|
|
10
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.mjs","sources":["../../../src/components/Modal/Modal.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs"],"mappings":";;;;;;MAMa,KAAK,GAAG,CAAC,EACpB,QAAQ,EACR,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,kBAAkB,GAAG,
|
|
1
|
+
{"version":3,"file":"Modal.mjs","sources":["../../../src/components/Modal/Modal.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs"],"mappings":";;;;;;MAMa,KAAK,GAAG,CAAC,EACpB,QAAQ,EACR,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,kBAAkB,GAAG,KAAK,EAC1B,GAAG,IAAI,EACI,KAAI;AACf,IAAA,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,EAAE,kBAAkB,EAAE,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC;AAEzE,IAAA,QACEA,GAAA,CAAC,MAAM,CAAC,IAAI,EAAA,EACV,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAC,QAAQ,EAClB,sBAAsB,EAAA,IAAA,EAAA,GAClB,IAAI,EAAA,QAAA,EAERC,IAAA,CAAC,MAAM,EAAA,EAAA,GAAK,WAAW,EAAA,QAAA,EAAA,CAIrBD,GAAA,CAAC,MAAM,CAAC,QAAQ,EAAA,EACd,KAAK,EAAE,EAAE,iBAAiB,EAAE,aAAa,EAAE,EAC3C,OAAO,EAAE,EAAE,iBAAiB,EAAE,MAAM,EAAE,EAAA,CACtC,EACFA,GAAA,CAAC,YAAY,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,GAAG,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAyB,CAAA,EAAA,CAC9D,EAAA,CACG;AAElB;;;;"}
|
|
@@ -2,8 +2,16 @@ import { Dialog, PortalProps } from '@chakra-ui/react';
|
|
|
2
2
|
export type ModalProps = Dialog.RootProps & {
|
|
3
3
|
portalProps?: PortalProps;
|
|
4
4
|
/**
|
|
5
|
-
* When true, the modal becomes fullscreen on mobile viewports
|
|
6
|
-
*
|
|
5
|
+
* When true, the modal becomes fullscreen on mobile viewports
|
|
6
|
+
* (100vw x 100dvh, no border-radius). When false it keeps the dialog
|
|
7
|
+
* shape and applies a horizontal margin instead.
|
|
8
|
+
*
|
|
9
|
+
* Defaults to false: a full-screen takeover suits long or immersive
|
|
10
|
+
* content (a file picker, a course switcher), not the confirm dialogs
|
|
11
|
+
* and short forms that make up most modals. Opt in where the takeover
|
|
12
|
+
* is the point.
|
|
13
|
+
*
|
|
14
|
+
* @default false
|
|
7
15
|
*/
|
|
8
16
|
fullScreenOnMobile?: boolean;
|
|
9
17
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.types.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/Modal.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEvD,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,SAAS,GAAG;IAG1C,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B
|
|
1
|
+
{"version":3,"file":"Modal.types.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/Modal.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEvD,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,SAAS,GAAG;IAG1C,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;;;;;;;;;;OAWG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalContext.js","sources":["../../../src/components/Modal/ModalContext.ts"],"sourcesContent":[null],"names":["createContext","useContext"],"mappings":";;;;;AAQO,MAAM,YAAY,GAAGA,mBAAa,CAAoB;AAC3D,IAAA,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"ModalContext.js","sources":["../../../src/components/Modal/ModalContext.ts"],"sourcesContent":[null],"names":["createContext","useContext"],"mappings":";;;;;AAQO,MAAM,YAAY,GAAGA,mBAAa,CAAoB;AAC3D,IAAA,kBAAkB,EAAE,KAAK;AAC1B,CAAA;AAEM,MAAM,eAAe,GAAG,MAAMC,gBAAU,CAAC,YAAY;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalContext.mjs","sources":["../../../src/components/Modal/ModalContext.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAQO,MAAM,YAAY,GAAG,aAAa,CAAoB;AAC3D,IAAA,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"ModalContext.mjs","sources":["../../../src/components/Modal/ModalContext.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAQO,MAAM,YAAY,GAAG,aAAa,CAAoB;AAC3D,IAAA,kBAAkB,EAAE,KAAK;AAC1B,CAAA;AAEM,MAAM,eAAe,GAAG,MAAM,UAAU,CAAC,YAAY;;;;"}
|
package/package.json
CHANGED
|
@@ -16,10 +16,10 @@ type Story = StoryObj<typeof meta>;
|
|
|
16
16
|
|
|
17
17
|
export const Default: Story = {};
|
|
18
18
|
|
|
19
|
-
export const
|
|
19
|
+
export const Wash: Story = {
|
|
20
20
|
args: {
|
|
21
|
-
variant: '
|
|
22
|
-
children: '
|
|
21
|
+
variant: 'wash',
|
|
22
|
+
children: 'Wash Card',
|
|
23
23
|
},
|
|
24
24
|
};
|
|
25
25
|
|
|
@@ -2,20 +2,44 @@
|
|
|
2
2
|
* Card styles using the Golden Ratio color system.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* The clickable hover is flat: the ground steps one tier to `bg.subtle` and
|
|
7
|
+
* the border darkens to `border.strong`. Nothing lifts and nothing grows a
|
|
8
|
+
* shadow. A raised hover said "this floats", and a card in a list does not;
|
|
9
|
+
* the tier step and the border say "this is the one under the pointer" with
|
|
10
|
+
* no elevation, and both tokens invert, so the state reads in dark mode where
|
|
11
|
+
* a neutral tint would vanish.
|
|
12
|
+
*/
|
|
5
13
|
export const clickableStyles = {
|
|
6
14
|
cursor: 'pointer',
|
|
7
15
|
_hover: {
|
|
8
|
-
|
|
16
|
+
bg: 'bg.subtle',
|
|
17
|
+
borderColor: 'border.strong',
|
|
9
18
|
},
|
|
10
19
|
};
|
|
11
20
|
|
|
21
|
+
/**
|
|
22
|
+
* The wash card: one tier off the page with a hairline. For a block that
|
|
23
|
+
* summarises or concludes (an AI summary, a total after a purchase, the
|
|
24
|
+
* invitation being accepted). It is what `gradient` used to paint with a
|
|
25
|
+
* 180deg wash and a brand-tinted border; the gradient read as decoration and
|
|
26
|
+
* the tinted border claimed brand for a surface that is not an action.
|
|
27
|
+
*
|
|
28
|
+
* The tier is `bg.subtle` in light but `bg.muted` in dark: `bg.subtle` sits
|
|
29
|
+
* one grayDark step above `bg.surface` there, too close to read as a different
|
|
30
|
+
* surface, and `border.subtle` resolves to the same step, so the hairline would
|
|
31
|
+
* vanish. `border.default` keeps the edge in both modes.
|
|
32
|
+
*/
|
|
33
|
+
const washStyles = {
|
|
34
|
+
bg: { base: 'bg.subtle', _dark: 'bg.muted' },
|
|
35
|
+
borderColor: 'border.default',
|
|
36
|
+
};
|
|
37
|
+
|
|
12
38
|
export const variantStyles = {
|
|
13
39
|
default: {},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
borderColor: 'primary.light',
|
|
18
|
-
},
|
|
40
|
+
wash: washStyles,
|
|
41
|
+
/** @deprecated Renders as `wash`; use `variant="wash"`. */
|
|
42
|
+
gradient: washStyles,
|
|
19
43
|
// Soft resting elevation — a gentle shadow does the separating, so the border
|
|
20
44
|
// can soften to `border.subtle` (which alone would be too faint, especially in
|
|
21
45
|
// dark mode). Use for standalone content cards that should read as raised
|
|
@@ -22,7 +22,8 @@ const CardImpl = forwardRef<HTMLDivElement, CardOwnProps>(
|
|
|
22
22
|
// border.default (gray.300 / gray.1100 _dark) instead of border.subtle:
|
|
23
23
|
// subtle's _dark (gray.1300 #1E2433) is ~invisible on bg.surface in dark,
|
|
24
24
|
// so cards blended into the canvas. default gives the card a discernible
|
|
25
|
-
// edge in both modes. The `
|
|
25
|
+
// edge in both modes. The `wash` variant softens it back to
|
|
26
|
+
// border.subtle because its `bg.subtle` fill already separates it.
|
|
26
27
|
borderColor="border.default"
|
|
27
28
|
borderRadius="lg"
|
|
28
29
|
// Was `transitionDuration="normal"` — a Chakra v2 token absent from v3.
|
|
@@ -4,7 +4,11 @@ import { CardRootProps as ChakraCardRootProps } from '@chakra-ui/react';
|
|
|
4
4
|
// Relative, NOT `@/types/*` — see `src/types/polymorphic.ts`.
|
|
5
5
|
import type { PolymorphicProps } from '../../types/polymorphic';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* `gradient` is a deprecated alias of `wash` and renders identically; it stays
|
|
9
|
+
* so consumers on the alpha line keep compiling while they migrate.
|
|
10
|
+
*/
|
|
11
|
+
export type CardVariant = 'default' | 'wash' | 'gradient' | 'elevated';
|
|
8
12
|
|
|
9
13
|
export type CardOwnProps = Omit<ChakraCardRootProps, 'as'> & {
|
|
10
14
|
clickable?: boolean;
|
|
@@ -482,13 +482,14 @@ export const PreventOutsideClick: Story = {
|
|
|
482
482
|
/**
|
|
483
483
|
* 모바일 풀스크린 모달 (기본값)
|
|
484
484
|
*
|
|
485
|
-
* fullScreenOnMobile
|
|
485
|
+
* fullScreenOnMobile을 true로 주면 모바일 뷰포트에서
|
|
486
486
|
* 모달이 전체 화면으로 표시됩니다 (100vw × 100dvh, border-radius 0).
|
|
487
|
+
* 기본값은 false이니 전체 화면이 필요한 곳에서만 켜세요.
|
|
487
488
|
* 브라우저를 좁혀서 확인해보세요.
|
|
488
489
|
*/
|
|
489
490
|
export const FullScreenOnMobile: Story = {
|
|
490
491
|
args: {
|
|
491
|
-
headerTitle: 'Full Screen on Mobile (
|
|
492
|
+
headerTitle: 'Full Screen on Mobile (opt-in)',
|
|
492
493
|
},
|
|
493
494
|
render: (args) => {
|
|
494
495
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -507,7 +508,7 @@ export const FullScreenOnMobile: Story = {
|
|
|
507
508
|
<ModalCloseButton />
|
|
508
509
|
<ModalBody>
|
|
509
510
|
모바일에서 이 모달은 전체 화면으로 표시됩니다. 브라우저 창을 좁혀서
|
|
510
|
-
확인해보세요. fullScreenOnMobile은 기본값이
|
|
511
|
+
확인해보세요. fullScreenOnMobile은 기본값이 false라 직접 켜야 합니다.
|
|
511
512
|
</ModalBody>
|
|
512
513
|
<ModalFooter>
|
|
513
514
|
<Button variant="ghost" onClick={() => setIsOpen(false)}>
|
|
@@ -527,13 +528,13 @@ export const FullScreenOnMobile: Story = {
|
|
|
527
528
|
/**
|
|
528
529
|
* 모바일에서 인라인 모달
|
|
529
530
|
*
|
|
530
|
-
* fullScreenOnMobile={false}이면 모바일에서도 풀스크린이 아닌
|
|
531
|
+
* fullScreenOnMobile={false}(기본값)이면 모바일에서도 풀스크린이 아닌
|
|
531
532
|
* 일반 모달로 표시되며, 좌우 마진(mx: 4)이 적용됩니다.
|
|
532
|
-
* Confirm 모달 등
|
|
533
|
+
* Confirm 모달 등 대부분의 모달이 여기에 해당합니다.
|
|
533
534
|
*/
|
|
534
535
|
export const NoFullScreenOnMobile: Story = {
|
|
535
536
|
args: {
|
|
536
|
-
headerTitle: 'Inline on Mobile',
|
|
537
|
+
headerTitle: 'Inline on Mobile (default)',
|
|
537
538
|
},
|
|
538
539
|
render: (args) => {
|
|
539
540
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -5,8 +5,16 @@ export type ModalProps = Dialog.RootProps & {
|
|
|
5
5
|
// Added for backwards compatibility.
|
|
6
6
|
portalProps?: PortalProps;
|
|
7
7
|
/**
|
|
8
|
-
* When true, the modal becomes fullscreen on mobile viewports
|
|
9
|
-
*
|
|
8
|
+
* When true, the modal becomes fullscreen on mobile viewports
|
|
9
|
+
* (100vw x 100dvh, no border-radius). When false it keeps the dialog
|
|
10
|
+
* shape and applies a horizontal margin instead.
|
|
11
|
+
*
|
|
12
|
+
* Defaults to false: a full-screen takeover suits long or immersive
|
|
13
|
+
* content (a file picker, a course switcher), not the confirm dialogs
|
|
14
|
+
* and short forms that make up most modals. Opt in where the takeover
|
|
15
|
+
* is the point.
|
|
16
|
+
*
|
|
17
|
+
* @default false
|
|
10
18
|
*/
|
|
11
19
|
fullScreenOnMobile?: boolean;
|
|
12
20
|
};
|