@sybilion/uilib 1.4.10 → 1.4.11
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/esm/components/ui/Renamer/Renamer.js +1 -1
- package/dist/esm/components/ui/Renamer/Renamer.styl.js +2 -2
- package/package.json +1 -1
- package/src/components/ui/Renamer/Renamer.styl +24 -4
- package/src/components/ui/Renamer/Renamer.styl.d.ts +2 -0
- package/src/components/ui/Renamer/Renamer.tsx +1 -1
- package/src/docs/pages/RenamerPage.tsx +97 -6
|
@@ -62,7 +62,7 @@ function Renamer({ value = '', onInput, onChange, children, className, placehold
|
|
|
62
62
|
}, onClick: e => {
|
|
63
63
|
e.stopPropagation();
|
|
64
64
|
handleEditClick();
|
|
65
|
-
}, size: buttonSizeMap[size], type: "button", children: jsx(PencilSimpleIcon, {
|
|
65
|
+
}, size: buttonSizeMap[size], type: "button", children: jsx(PencilSimpleIcon, { "aria-hidden": true }) }) }), jsx(TooltipContent, { side: "bottom", children: "Rename" })] })] })) }));
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
export { Renamer };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styleInject from 'style-inject';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".Renamer_root__26OvT{
|
|
4
|
-
var S = {"root":"Renamer_root__26OvT","value":"Renamer_value__G8b1D","size-lg":"Renamer_size-lg__dfVhW","
|
|
3
|
+
var css_248z = ".Renamer_root__26OvT{display:inline-block;max-width:100%;vertical-align:top}.Renamer_root__26OvT:has(.Renamer_input__KRnGn){display:block;width:100%}.Renamer_value__G8b1D{display:inline}.Renamer_size-lg__dfVhW.Renamer_root__26OvT .Renamer_input__KRnGn,.Renamer_size-lg__dfVhW.Renamer_root__26OvT .Renamer_value__G8b1D{color:var(--foreground);font-family:var(--font-family-heading);font-size:var(--text-2xl);font-weight:300;line-height:var(--text-2xl)}.Renamer_size-lg__dfVhW.Renamer_root__26OvT .Renamer_input__KRnGn{border-radius:var(--p-4);box-shadow:0 0 0 1px var(--border);height:auto;min-height:var(--text-2xl);padding:4px 12px 4px 0}.Renamer_empty__A7xx1.Renamer_size-lg__dfVhW.Renamer_root__26OvT .Renamer_input__KRnGn{background-color:var(--accent)/.1}.Renamer_button__jKMLc{display:inline-flex;margin-left:var(--p-2);opacity:.5;transition:opacity .2s ease-out;vertical-align:middle}.Renamer_root__26OvT:hover .Renamer_button__jKMLc{opacity:1}.Renamer_size-sm__vycEN.Renamer_root__26OvT .Renamer_button__jKMLc svg{height:var(--icon-size-sm);width:var(--icon-size-sm)}.Renamer_size-md__aWSQi.Renamer_root__26OvT .Renamer_button__jKMLc svg{height:var(--icon-size-md);width:var(--icon-size-md)}.Renamer_size-lg__dfVhW.Renamer_root__26OvT .Renamer_button__jKMLc svg{height:var(--icon-size-lg);width:var(--icon-size-lg)}";
|
|
4
|
+
var S = {"root":"Renamer_root__26OvT","input":"Renamer_input__KRnGn","value":"Renamer_value__G8b1D","size-lg":"Renamer_size-lg__dfVhW","empty":"Renamer_empty__A7xx1","button":"Renamer_button__jKMLc","size-sm":"Renamer_size-sm__vycEN","size-md":"Renamer_size-md__aWSQi"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { S as default };
|
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
.root
|
|
2
|
-
display
|
|
3
|
-
|
|
2
|
+
display inline-block
|
|
3
|
+
max-width 100%
|
|
4
|
+
vertical-align top
|
|
5
|
+
|
|
6
|
+
&:has(.input)
|
|
7
|
+
display block
|
|
8
|
+
width 100%
|
|
4
9
|
|
|
5
10
|
.value
|
|
6
|
-
|
|
11
|
+
display inline
|
|
7
12
|
|
|
8
13
|
// Matches PageHeader .title h1 typography (page title context).
|
|
9
14
|
.size-lg.root
|
|
@@ -30,9 +35,24 @@
|
|
|
30
35
|
background-color var(--accent) / 0.1
|
|
31
36
|
|
|
32
37
|
.button
|
|
33
|
-
|
|
38
|
+
display inline-flex
|
|
39
|
+
vertical-align middle
|
|
40
|
+
margin-left var(--p-2)
|
|
34
41
|
opacity 0.5
|
|
35
42
|
transition opacity 0.2s ease-out
|
|
36
43
|
|
|
37
44
|
.root:hover &
|
|
38
45
|
opacity 1
|
|
46
|
+
|
|
47
|
+
// Pencil icon tracks Button `size` via --icon-size-* tokens (sm 14 / md 16 / lg 20px).
|
|
48
|
+
.size-sm.root .button svg
|
|
49
|
+
width var(--icon-size-sm)
|
|
50
|
+
height var(--icon-size-sm)
|
|
51
|
+
|
|
52
|
+
.size-md.root .button svg
|
|
53
|
+
width var(--icon-size-md)
|
|
54
|
+
height var(--icon-size-md)
|
|
55
|
+
|
|
56
|
+
.size-lg.root .button svg
|
|
57
|
+
width var(--icon-size-lg)
|
|
58
|
+
height var(--icon-size-lg)
|
|
@@ -9,21 +9,112 @@ import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
|
|
|
9
9
|
import { DocsHeaderActions } from '../docsHeaderActions';
|
|
10
10
|
|
|
11
11
|
export default function RenamerPage() {
|
|
12
|
-
const [
|
|
12
|
+
const [smName, setSmName] = useState('Export settings');
|
|
13
|
+
const [mdName, setMdName] = useState('Dataset name');
|
|
14
|
+
const [lgName, setLgName] = useState('Release notes');
|
|
15
|
+
const [lgLongName, setLgLongName] = useState(
|
|
16
|
+
'Quarterly revenue forecast and variance analysis for North America',
|
|
17
|
+
);
|
|
13
18
|
|
|
14
19
|
return (
|
|
15
20
|
<>
|
|
16
21
|
<AppPageHeader
|
|
17
22
|
breadcrumbs={[{ label: 'Renamer' }]}
|
|
18
23
|
title="Renamer"
|
|
19
|
-
subheader="Inline rename with pencil control."
|
|
24
|
+
subheader="Inline rename with pencil control — sm, md, and lg sizes."
|
|
20
25
|
actions={<DocsHeaderActions />}
|
|
21
26
|
/>
|
|
22
27
|
<DocsGuidance source={renamerGuidance} />
|
|
23
|
-
<PageContentSection
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
<PageContentSection
|
|
29
|
+
style={{ display: 'flex', flexDirection: 'column', gap: '2rem' }}
|
|
30
|
+
>
|
|
31
|
+
<section>
|
|
32
|
+
<h3 style={{ marginBottom: '1rem' }}>Sizes</h3>
|
|
33
|
+
<p
|
|
34
|
+
style={{
|
|
35
|
+
marginBottom: '0.75rem',
|
|
36
|
+
color: 'var(--muted-foreground)',
|
|
37
|
+
}}
|
|
38
|
+
>
|
|
39
|
+
Pass <code>size</code> for sm / md / lg. The pencil icon scales with
|
|
40
|
+
the size; <code>lg</code> uses page-title typography.
|
|
41
|
+
</p>
|
|
42
|
+
<div
|
|
43
|
+
style={{
|
|
44
|
+
display: 'flex',
|
|
45
|
+
flexDirection: 'column',
|
|
46
|
+
gap: '1.5rem',
|
|
47
|
+
}}
|
|
48
|
+
>
|
|
49
|
+
<div>
|
|
50
|
+
<div
|
|
51
|
+
style={{
|
|
52
|
+
marginBottom: '0.5rem',
|
|
53
|
+
fontWeight: 600,
|
|
54
|
+
fontSize: '0.875rem',
|
|
55
|
+
}}
|
|
56
|
+
>
|
|
57
|
+
sm
|
|
58
|
+
</div>
|
|
59
|
+
<Renamer value={smName} onChange={setSmName} size="sm">
|
|
60
|
+
{smName}
|
|
61
|
+
</Renamer>
|
|
62
|
+
</div>
|
|
63
|
+
<div>
|
|
64
|
+
<div
|
|
65
|
+
style={{
|
|
66
|
+
marginBottom: '0.5rem',
|
|
67
|
+
fontWeight: 600,
|
|
68
|
+
fontSize: '0.875rem',
|
|
69
|
+
}}
|
|
70
|
+
>
|
|
71
|
+
md
|
|
72
|
+
</div>
|
|
73
|
+
<Renamer value={mdName} onChange={setMdName} size="md">
|
|
74
|
+
{mdName}
|
|
75
|
+
</Renamer>
|
|
76
|
+
</div>
|
|
77
|
+
<div>
|
|
78
|
+
<div
|
|
79
|
+
style={{
|
|
80
|
+
marginBottom: '0.5rem',
|
|
81
|
+
fontWeight: 600,
|
|
82
|
+
fontSize: '0.875rem',
|
|
83
|
+
}}
|
|
84
|
+
>
|
|
85
|
+
lg
|
|
86
|
+
</div>
|
|
87
|
+
<Renamer value={lgName} onChange={setLgName} size="lg">
|
|
88
|
+
{lgName}
|
|
89
|
+
</Renamer>
|
|
90
|
+
</div>
|
|
91
|
+
<div>
|
|
92
|
+
<div
|
|
93
|
+
style={{
|
|
94
|
+
marginBottom: '0.5rem',
|
|
95
|
+
fontWeight: 600,
|
|
96
|
+
fontSize: '0.875rem',
|
|
97
|
+
}}
|
|
98
|
+
>
|
|
99
|
+
lg — wrapping title
|
|
100
|
+
</div>
|
|
101
|
+
<p
|
|
102
|
+
style={{
|
|
103
|
+
marginBottom: '0.75rem',
|
|
104
|
+
color: 'var(--muted-foreground)',
|
|
105
|
+
fontSize: '0.875rem',
|
|
106
|
+
}}
|
|
107
|
+
>
|
|
108
|
+
Long titles wrap; the pencil stays inline after the last line.
|
|
109
|
+
</p>
|
|
110
|
+
<div style={{ maxWidth: '20rem' }}>
|
|
111
|
+
<Renamer value={lgLongName} onChange={setLgLongName} size="lg">
|
|
112
|
+
{lgLongName}
|
|
113
|
+
</Renamer>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
</section>
|
|
27
118
|
</PageContentSection>
|
|
28
119
|
</>
|
|
29
120
|
);
|