@orioncactuscorp/ui 1.7.0 → 1.9.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/components/Accordion/Accordion.css +1 -1
- package/dist/components/Alert/Alert.js +1 -1
- package/dist/components/Button/Button.css +1 -1
- package/dist/components/Checkbox/Checkbox.css +1 -1
- package/dist/components/Modal/Modal.css +1 -1
- package/dist/components/Modal/Modal.js +671 -517
- package/dist/components/Modal/bottomSheetGeometry.js +88 -0
- package/dist/components/Modal/modalScrollArbitration.js +8 -7
- package/dist/components/Modal/snapPoints.js +9 -8
- package/dist/components/Modal/useModalContentBlockTransition.js +64 -0
- package/dist/components/Modal/useModalDrag.js +917 -788
- package/dist/components/Radio/Radio.css +1 -1
- package/dist/components/ScrollArea/ScrollArea.css +1 -1
- package/dist/components/ScrollArea/ScrollArea.js +250 -223
- package/dist/components/ScrollArea/useScrollAreaGeometryStabilizer.js +36 -0
- package/dist/components/TextButton/TextButton.css +1 -1
- package/dist/components/TextButton/TextButton.module.scss.js +8 -6
- package/dist/components/internal/DisclosureIndicator.js +23 -23
- package/dist/styles.css +7 -7
- package/dist/ui/src/components/Modal/Modal.d.ts +2 -2
- package/dist/ui/src/components/Modal/Modal.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/bottomSheetGeometry.d.ts +36 -0
- package/dist/ui/src/components/Modal/bottomSheetGeometry.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/index.d.ts +1 -1
- package/dist/ui/src/components/Modal/index.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/modalScrollArbitration.d.ts +2 -1
- package/dist/ui/src/components/Modal/modalScrollArbitration.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/snapPoints.d.ts +1 -0
- package/dist/ui/src/components/Modal/snapPoints.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/types.d.ts +11 -1
- package/dist/ui/src/components/Modal/types.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/useModalContentBlockTransition.d.ts +5 -0
- package/dist/ui/src/components/Modal/useModalContentBlockTransition.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/useModalDrag.d.ts +5 -1
- package/dist/ui/src/components/Modal/useModalDrag.d.ts.map +1 -1
- package/dist/ui/src/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/ui/src/components/ScrollArea/useScrollAreaGeometryStabilizer.d.ts +11 -0
- package/dist/ui/src/components/ScrollArea/useScrollAreaGeometryStabilizer.d.ts.map +1 -0
- package/dist/ui/src/index.d.ts +1 -1
- package/dist/ui/src/index.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/scss/mixins/_element.scss +161 -14
- package/src/scss/mixins/_element.test.ts +94 -5
- package/src/scss/mixins/_icon.scss +27 -0
|
@@ -2,7 +2,7 @@ import { compileString } from 'sass';
|
|
|
2
2
|
import { describe, expect, it } from 'vitest';
|
|
3
3
|
|
|
4
4
|
describe('oc-border mixin', () => {
|
|
5
|
-
it('emits a 1px
|
|
5
|
+
it('emits a 1px currentcolor inset border by default', () => {
|
|
6
6
|
const result = compileString(
|
|
7
7
|
`
|
|
8
8
|
@use 'element' as *;
|
|
@@ -16,7 +16,7 @@ describe('oc-border mixin', () => {
|
|
|
16
16
|
},
|
|
17
17
|
);
|
|
18
18
|
|
|
19
|
-
expect(result.css).toContain('box-shadow: inset 0 0 0 1px
|
|
19
|
+
expect(result.css).toContain('box-shadow: inset 0 0 0 1px currentcolor;');
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
it('treats a single non-number argument as the border color', () => {
|
|
@@ -54,6 +54,76 @@ describe('oc-border mixin', () => {
|
|
|
54
54
|
expect(result.css).not.toContain('@supports');
|
|
55
55
|
});
|
|
56
56
|
|
|
57
|
+
it('accepts CSS-like space-separated border shorthand', () => {
|
|
58
|
+
const result = compileString(
|
|
59
|
+
`
|
|
60
|
+
@use 'element' as *;
|
|
61
|
+
|
|
62
|
+
.target {
|
|
63
|
+
@include oc-border(1px solid top outer var(--stroke));
|
|
64
|
+
}
|
|
65
|
+
`,
|
|
66
|
+
{
|
|
67
|
+
loadPaths: ['src/scss/mixins'],
|
|
68
|
+
},
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
expect(result.css).toContain('box-shadow: 0 -1px 0 0 var(--stroke);');
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it('accepts solid as a no-op style token for border shorthand familiarity', () => {
|
|
75
|
+
const result = compileString(
|
|
76
|
+
`
|
|
77
|
+
@use 'element' as *;
|
|
78
|
+
|
|
79
|
+
.target {
|
|
80
|
+
@include oc-border(1px solid black);
|
|
81
|
+
}
|
|
82
|
+
`,
|
|
83
|
+
{
|
|
84
|
+
loadPaths: ['src/scss/mixins'],
|
|
85
|
+
},
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
expect(result.css).toContain('box-shadow: inset 0 0 0 1px black;');
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it('emits multiple side shadows in shorthand order', () => {
|
|
92
|
+
const result = compileString(
|
|
93
|
+
`
|
|
94
|
+
@use 'element' as *;
|
|
95
|
+
|
|
96
|
+
.target {
|
|
97
|
+
@include oc-border(1px top right var(--stroke));
|
|
98
|
+
}
|
|
99
|
+
`,
|
|
100
|
+
{
|
|
101
|
+
loadPaths: ['src/scss/mixins'],
|
|
102
|
+
},
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
expect(result.css).toContain(
|
|
106
|
+
'box-shadow: inset 0 1px 0 0 var(--stroke), inset -1px 0 0 0 var(--stroke);',
|
|
107
|
+
);
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
it('keeps comma-separated width and color calls compatible', () => {
|
|
111
|
+
const result = compileString(
|
|
112
|
+
`
|
|
113
|
+
@use 'element' as *;
|
|
114
|
+
|
|
115
|
+
.target {
|
|
116
|
+
@include oc-border(1px, var(--stroke));
|
|
117
|
+
}
|
|
118
|
+
`,
|
|
119
|
+
{
|
|
120
|
+
loadPaths: ['src/scss/mixins'],
|
|
121
|
+
},
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
expect(result.css).toContain('box-shadow: inset 0 0 0 1px var(--stroke);');
|
|
125
|
+
});
|
|
126
|
+
|
|
57
127
|
it('adds WebKit DPR correction for 1.5px borders', () => {
|
|
58
128
|
const result = compileString(
|
|
59
129
|
`
|
|
@@ -68,14 +138,33 @@ describe('oc-border mixin', () => {
|
|
|
68
138
|
},
|
|
69
139
|
);
|
|
70
140
|
|
|
71
|
-
expect(result.css).toContain('box-shadow: inset 0 0 0 1.5px
|
|
141
|
+
expect(result.css).toContain('box-shadow: inset 0 0 0 1.5px currentcolor;');
|
|
72
142
|
expect(result.css).toContain('@supports (-webkit-backdrop-filter: none)');
|
|
73
|
-
expect(result.css).toContain('box-shadow: inset 0 0 0 1px
|
|
143
|
+
expect(result.css).toContain('box-shadow: inset 0 0 0 1px currentcolor;');
|
|
74
144
|
expect(result.css).toContain('@media only screen and (resolution: 2dppx)');
|
|
75
145
|
expect(result.css).toContain('@media only screen and (resolution: 3dppx)');
|
|
76
146
|
expect(result.css).toContain(
|
|
77
|
-
'box-shadow: inset 0 0 0 1.6666px
|
|
147
|
+
'box-shadow: inset 0 0 0 1.6666px currentcolor;',
|
|
148
|
+
);
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
it('applies WebKit DPR correction to directional outer borders', () => {
|
|
152
|
+
const result = compileString(
|
|
153
|
+
`
|
|
154
|
+
@use 'element' as *;
|
|
155
|
+
|
|
156
|
+
.target {
|
|
157
|
+
@include oc-border(1.5px bottom outer var(--stroke));
|
|
158
|
+
}
|
|
159
|
+
`,
|
|
160
|
+
{
|
|
161
|
+
loadPaths: ['src/scss/mixins'],
|
|
162
|
+
},
|
|
78
163
|
);
|
|
164
|
+
|
|
165
|
+
expect(result.css).toContain('box-shadow: 0 1.5px 0 0 var(--stroke);');
|
|
166
|
+
expect(result.css).toContain('box-shadow: 0 1px 0 0 var(--stroke);');
|
|
167
|
+
expect(result.css).toContain('box-shadow: 0 1.6666px 0 0 var(--stroke);');
|
|
79
168
|
});
|
|
80
169
|
|
|
81
170
|
it('generalizes WebKit DPR correction for half-pixel borders', () => {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Sizes an SvgIcon slot from the inherited line box.
|
|
2
|
+
// block-size(높이)만 line box 기준으로 잡고 inline-size는 auto라, SVG viewBox 비율대로
|
|
3
|
+
// 너비가 따라온다. 강제 1:1이 아니라 종횡비 보존.
|
|
4
|
+
// - $inset: line box에서 뺄 breathing room (raw em). 컴포넌트가 $inset-var CSS 변수로
|
|
5
|
+
// size별 override 가능하고, mixin 인자는 그 변수의 default다.
|
|
6
|
+
// - $fallback: `1lh` 미지원(pre-2023) 브라우저 전용. 생략 시 line height를 1.5em로
|
|
7
|
+
// 가정해 `1.5em - inset*2`로 자동 근사한다. 새 컴포넌트는 신경 쓸 필요 없다.
|
|
8
|
+
@mixin oc-icon-box($size-var, $inset-var, $inset: 0.1875em, $fallback: null) {
|
|
9
|
+
$inset-expr: var(#{$inset-var}, #{$inset});
|
|
10
|
+
$fallback-size: $fallback;
|
|
11
|
+
|
|
12
|
+
@if $fallback == null {
|
|
13
|
+
$fallback-size: calc(1.5em - (#{$inset-expr} * 2));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
inline-size: auto;
|
|
17
|
+
|
|
18
|
+
// BEGIN 1lh fallback layer — `1lh`이 완전 baseline이 되면 이 base 선언과 @supports
|
|
19
|
+
// 래퍼를 지우고 @supports 안의 block-size 한 줄만 이 자리로 올리면 된다. call site 무영향.
|
|
20
|
+
block-size: var(#{$size-var}, #{$fallback-size});
|
|
21
|
+
@supports (block-size: 1lh) {
|
|
22
|
+
// stylelint-disable-next-line no-invalid-position-declaration -- mixin body는 항상 selector 안에서 @include된다
|
|
23
|
+
block-size: var(#{$size-var}, calc(1lh - (#{$inset-expr} * 2)));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// END 1lh fallback layer — 위 base 선언 + @supports 래퍼만 삭제.
|
|
27
|
+
}
|