@cloud-ru/ds-uikit-product-widget 1.0.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/CHANGELOG.md +8 -0
- package/LICENSE +201 -0
- package/README.md +374 -0
- package/dist/cjs/components/Widget/Widget.d.ts +2 -0
- package/dist/cjs/components/Widget/Widget.js +42 -0
- package/dist/cjs/components/Widget/index.d.ts +1 -0
- package/dist/cjs/components/Widget/index.js +17 -0
- package/dist/cjs/components/Widget/styles.module.css +284 -0
- package/dist/cjs/components/index.d.ts +1 -0
- package/dist/cjs/components/index.js +17 -0
- package/dist/cjs/constants.d.ts +25 -0
- package/dist/cjs/constants.js +28 -0
- package/dist/cjs/helperComponents/Actions/ActionView.d.ts +10 -0
- package/dist/cjs/helperComponents/Actions/ActionView.js +40 -0
- package/dist/cjs/helperComponents/Actions/Actions.d.ts +12 -0
- package/dist/cjs/helperComponents/Actions/Actions.js +43 -0
- package/dist/cjs/helperComponents/Actions/helpers.d.ts +21 -0
- package/dist/cjs/helperComponents/Actions/helpers.js +57 -0
- package/dist/cjs/helperComponents/Actions/index.d.ts +3 -0
- package/dist/cjs/helperComponents/Actions/index.js +21 -0
- package/dist/cjs/helperComponents/Actions/styles.module.css +46 -0
- package/dist/cjs/helperComponents/ButtonDroplist/ActionList.d.ts +9 -0
- package/dist/cjs/helperComponents/ButtonDroplist/ActionList.js +39 -0
- package/dist/cjs/helperComponents/ButtonDroplist/ButtonDroplist.d.ts +2 -0
- package/dist/cjs/helperComponents/ButtonDroplist/ButtonDroplist.js +34 -0
- package/dist/cjs/helperComponents/ButtonDroplist/index.d.ts +1 -0
- package/dist/cjs/helperComponents/ButtonDroplist/index.js +17 -0
- package/dist/cjs/helperComponents/ButtonDroplist/styles.module.css +5 -0
- package/dist/cjs/helperComponents/ButtonKebab/ButtonKebab.d.ts +2 -0
- package/dist/cjs/helperComponents/ButtonKebab/ButtonKebab.js +18 -0
- package/dist/cjs/helperComponents/ButtonKebab/index.d.ts +1 -0
- package/dist/cjs/helperComponents/ButtonKebab/index.js +17 -0
- package/dist/cjs/helperComponents/ButtonKebab/styles.module.css +5 -0
- package/dist/cjs/helperComponents/Content/Content.d.ts +11 -0
- package/dist/cjs/helperComponents/Content/Content.js +36 -0
- package/dist/cjs/helperComponents/Content/index.d.ts +1 -0
- package/dist/cjs/helperComponents/Content/index.js +17 -0
- package/dist/cjs/helperComponents/Content/styles.module.css +22 -0
- package/dist/cjs/helperComponents/ControlBlock/ControlBlock.d.ts +12 -0
- package/dist/cjs/helperComponents/ControlBlock/ControlBlock.js +22 -0
- package/dist/cjs/helperComponents/ControlBlock/index.d.ts +1 -0
- package/dist/cjs/helperComponents/ControlBlock/index.js +17 -0
- package/dist/cjs/helperComponents/ControlBlock/styles.module.css +12 -0
- package/dist/cjs/helperComponents/index.d.ts +5 -0
- package/dist/cjs/helperComponents/index.js +21 -0
- package/dist/cjs/index.d.ts +4 -0
- package/dist/cjs/index.js +20 -0
- package/dist/cjs/locale/index.d.ts +27 -0
- package/dist/cjs/locale/index.js +18 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/style.css +374 -0
- package/dist/cjs/types.d.ts +116 -0
- package/dist/cjs/types.js +2 -0
- package/dist/esm/components/Widget/Widget.d.ts +2 -0
- package/dist/esm/components/Widget/Widget.js +36 -0
- package/dist/esm/components/Widget/index.d.ts +1 -0
- package/dist/esm/components/Widget/index.js +1 -0
- package/dist/esm/components/Widget/styles.module.css +284 -0
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/constants.d.ts +25 -0
- package/dist/esm/constants.js +25 -0
- package/dist/esm/helperComponents/Actions/ActionView.d.ts +10 -0
- package/dist/esm/helperComponents/Actions/ActionView.js +37 -0
- package/dist/esm/helperComponents/Actions/Actions.d.ts +12 -0
- package/dist/esm/helperComponents/Actions/Actions.js +37 -0
- package/dist/esm/helperComponents/Actions/helpers.d.ts +21 -0
- package/dist/esm/helperComponents/Actions/helpers.js +50 -0
- package/dist/esm/helperComponents/Actions/index.d.ts +3 -0
- package/dist/esm/helperComponents/Actions/index.js +3 -0
- package/dist/esm/helperComponents/Actions/styles.module.css +46 -0
- package/dist/esm/helperComponents/ButtonDroplist/ActionList.d.ts +9 -0
- package/dist/esm/helperComponents/ButtonDroplist/ActionList.js +33 -0
- package/dist/esm/helperComponents/ButtonDroplist/ButtonDroplist.d.ts +2 -0
- package/dist/esm/helperComponents/ButtonDroplist/ButtonDroplist.js +28 -0
- package/dist/esm/helperComponents/ButtonDroplist/index.d.ts +1 -0
- package/dist/esm/helperComponents/ButtonDroplist/index.js +1 -0
- package/dist/esm/helperComponents/ButtonDroplist/styles.module.css +5 -0
- package/dist/esm/helperComponents/ButtonKebab/ButtonKebab.d.ts +2 -0
- package/dist/esm/helperComponents/ButtonKebab/ButtonKebab.js +12 -0
- package/dist/esm/helperComponents/ButtonKebab/index.d.ts +1 -0
- package/dist/esm/helperComponents/ButtonKebab/index.js +1 -0
- package/dist/esm/helperComponents/ButtonKebab/styles.module.css +5 -0
- package/dist/esm/helperComponents/Content/Content.d.ts +11 -0
- package/dist/esm/helperComponents/Content/Content.js +30 -0
- package/dist/esm/helperComponents/Content/index.d.ts +1 -0
- package/dist/esm/helperComponents/Content/index.js +1 -0
- package/dist/esm/helperComponents/Content/styles.module.css +22 -0
- package/dist/esm/helperComponents/ControlBlock/ControlBlock.d.ts +12 -0
- package/dist/esm/helperComponents/ControlBlock/ControlBlock.js +16 -0
- package/dist/esm/helperComponents/ControlBlock/index.d.ts +1 -0
- package/dist/esm/helperComponents/ControlBlock/index.js +1 -0
- package/dist/esm/helperComponents/ControlBlock/styles.module.css +12 -0
- package/dist/esm/helperComponents/index.d.ts +5 -0
- package/dist/esm/helperComponents/index.js +5 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/locale/index.d.ts +27 -0
- package/dist/esm/locale/index.js +15 -0
- package/dist/esm/style.css +374 -0
- package/dist/esm/types.d.ts +116 -0
- package/dist/esm/types.js +1 -0
- package/dist/tsconfig.cjs.tsbuildinfo +1 -0
- package/dist/tsconfig.esm.tsbuildinfo +1 -0
- package/package.json +59 -0
- package/src/components/Widget/Widget.tsx +113 -0
- package/src/components/Widget/index.ts +1 -0
- package/src/components/Widget/styles.module.scss +93 -0
- package/src/components/index.ts +1 -0
- package/src/constants.ts +27 -0
- package/src/helperComponents/Actions/ActionView.tsx +56 -0
- package/src/helperComponents/Actions/Actions.tsx +84 -0
- package/src/helperComponents/Actions/helpers.ts +84 -0
- package/src/helperComponents/Actions/index.ts +3 -0
- package/src/helperComponents/Actions/styles.module.scss +54 -0
- package/src/helperComponents/ButtonDroplist/ButtonDroplist.tsx +50 -0
- package/src/helperComponents/ButtonDroplist/index.ts +1 -0
- package/src/helperComponents/ButtonDroplist/styles.module.scss +5 -0
- package/src/helperComponents/ButtonKebab/ButtonKebab.tsx +36 -0
- package/src/helperComponents/ButtonKebab/index.ts +1 -0
- package/src/helperComponents/ButtonKebab/styles.module.scss +5 -0
- package/src/helperComponents/Content/Content.tsx +72 -0
- package/src/helperComponents/Content/index.ts +1 -0
- package/src/helperComponents/Content/styles.module.scss +26 -0
- package/src/helperComponents/ControlBlock/ControlBlock.tsx +40 -0
- package/src/helperComponents/ControlBlock/index.ts +1 -0
- package/src/helperComponents/ControlBlock/styles.module.scss +16 -0
- package/src/helperComponents/index.ts +5 -0
- package/src/index.ts +4 -0
- package/src/locale/index.ts +19 -0
- package/src/types.ts +151 -0
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
.widget{
|
|
3
|
+
position:relative;
|
|
4
|
+
display:flex;
|
|
5
|
+
flex-direction:column;
|
|
6
|
+
gap:var(--sn-primitive-dimension-12, 12px);
|
|
7
|
+
box-sizing:border-box;
|
|
8
|
+
width:100%;
|
|
9
|
+
min-width:0;
|
|
10
|
+
padding:var(--sn-primitive-dimension-16, 16px);
|
|
11
|
+
border-radius:var(--sn-card-anatomy-radius-l-container-borderRadius, var(--sn-brand-anatomy-radius-card-l, var(--sn-primitive-dimension-4, 4px)));
|
|
12
|
+
color:var(--sn-theme-color-available-version-textMain, var(--sn-brand-color-text-version-main, #41424e));
|
|
13
|
+
background:var(--sn-theme-color-neutral-background1Level, var(--sn-brand-color-neutral-95, var(--sn-primitive-color-gray-95, #fdfdfd)));
|
|
14
|
+
}
|
|
15
|
+
.widget[data-acrylic-appearance=primary][data-acrylic-level=default]{
|
|
16
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground, 0) / 2));
|
|
17
|
+
}
|
|
18
|
+
.widget[data-acrylic-appearance=primary][data-acrylic-level=default] .acrylic{
|
|
19
|
+
opacity:var(--sn-acrylic-opacityBackground, 1);
|
|
20
|
+
background:var(--sn-theme-color-primary-background, var(--sn-brand-color-primary-90, var(--sn-brandRole-color-brandA-90, var(--sn-primitive-color-brandA-90, #edf7f1))));
|
|
21
|
+
}
|
|
22
|
+
.widget[data-acrylic-appearance=primary][data-acrylic-level="1Level"]{
|
|
23
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground1Level, 0) / 2));
|
|
24
|
+
}
|
|
25
|
+
.widget[data-acrylic-appearance=primary][data-acrylic-level="1Level"] .acrylic{
|
|
26
|
+
opacity:var(--sn-acrylic-opacityBackground1Level, 1);
|
|
27
|
+
background:var(--sn-theme-color-primary-background1Level, var(--sn-brand-color-primary-95, var(--sn-brandRole-color-brandA-95, var(--sn-primitive-color-brandA-95, #f5fdf8))));
|
|
28
|
+
}
|
|
29
|
+
.widget[data-acrylic-appearance=primary][data-acrylic-level="2Level"]{
|
|
30
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground2Level, 0) / 2));
|
|
31
|
+
}
|
|
32
|
+
.widget[data-acrylic-appearance=primary][data-acrylic-level="2Level"] .acrylic{
|
|
33
|
+
opacity:var(--sn-acrylic-opacityBackground2Level, 1);
|
|
34
|
+
background:var(--sn-theme-color-primary-background2Level, var(--sn-brand-color-primary-99, var(--sn-brandRole-color-brandA-99, var(--sn-primitive-color-brandA-99, #fbfffc))));
|
|
35
|
+
}
|
|
36
|
+
.widget[data-acrylic-appearance=neutral][data-acrylic-level=default]{
|
|
37
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground, 0) / 2));
|
|
38
|
+
}
|
|
39
|
+
.widget[data-acrylic-appearance=neutral][data-acrylic-level=default] .acrylic{
|
|
40
|
+
opacity:var(--sn-acrylic-opacityBackground, 1);
|
|
41
|
+
background:var(--sn-theme-color-neutral-background, var(--sn-brand-color-neutral-90, var(--sn-primitive-color-gray-90, #eeeff3)));
|
|
42
|
+
}
|
|
43
|
+
.widget[data-acrylic-appearance=neutral][data-acrylic-level="1Level"]{
|
|
44
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground1Level, 0) / 2));
|
|
45
|
+
}
|
|
46
|
+
.widget[data-acrylic-appearance=neutral][data-acrylic-level="1Level"] .acrylic{
|
|
47
|
+
opacity:var(--sn-acrylic-opacityBackground1Level, 1);
|
|
48
|
+
background:var(--sn-theme-color-neutral-background1Level, var(--sn-brand-color-neutral-95, var(--sn-primitive-color-gray-95, #fdfdfd)));
|
|
49
|
+
}
|
|
50
|
+
.widget[data-acrylic-appearance=neutral][data-acrylic-level="2Level"]{
|
|
51
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground2Level, 0) / 2));
|
|
52
|
+
}
|
|
53
|
+
.widget[data-acrylic-appearance=neutral][data-acrylic-level="2Level"] .acrylic{
|
|
54
|
+
opacity:var(--sn-acrylic-opacityBackground2Level, 1);
|
|
55
|
+
background:var(--sn-theme-color-neutral-background2Level, var(--sn-brand-color-neutral-99, var(--sn-primitive-color-gray-99, #ffffff)));
|
|
56
|
+
}
|
|
57
|
+
.widget[data-acrylic-appearance=red][data-acrylic-level=default]{
|
|
58
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground, 0) / 2));
|
|
59
|
+
}
|
|
60
|
+
.widget[data-acrylic-appearance=red][data-acrylic-level=default] .acrylic{
|
|
61
|
+
opacity:var(--sn-acrylic-opacityBackground, 1);
|
|
62
|
+
background:var(--sn-theme-color-red-background, var(--sn-primitive-color-red-90, #fee8e5));
|
|
63
|
+
}
|
|
64
|
+
.widget[data-acrylic-appearance=red][data-acrylic-level="1Level"]{
|
|
65
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground1Level, 0) / 2));
|
|
66
|
+
}
|
|
67
|
+
.widget[data-acrylic-appearance=red][data-acrylic-level="1Level"] .acrylic{
|
|
68
|
+
opacity:var(--sn-acrylic-opacityBackground1Level, 1);
|
|
69
|
+
background:var(--sn-theme-color-red-background1Level, var(--sn-primitive-color-red-95, #fef5f1));
|
|
70
|
+
}
|
|
71
|
+
.widget[data-acrylic-appearance=red][data-acrylic-level="2Level"]{
|
|
72
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground2Level, 0) / 2));
|
|
73
|
+
}
|
|
74
|
+
.widget[data-acrylic-appearance=red][data-acrylic-level="2Level"] .acrylic{
|
|
75
|
+
opacity:var(--sn-acrylic-opacityBackground2Level, 1);
|
|
76
|
+
background:var(--sn-theme-color-red-background2Level, var(--sn-primitive-color-red-99, #fffaf7));
|
|
77
|
+
}
|
|
78
|
+
.widget[data-acrylic-appearance=orange][data-acrylic-level=default]{
|
|
79
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground, 0) / 2));
|
|
80
|
+
}
|
|
81
|
+
.widget[data-acrylic-appearance=orange][data-acrylic-level=default] .acrylic{
|
|
82
|
+
opacity:var(--sn-acrylic-opacityBackground, 1);
|
|
83
|
+
background:var(--sn-theme-color-orange-background, var(--sn-primitive-color-orange-90, #ffedcf));
|
|
84
|
+
}
|
|
85
|
+
.widget[data-acrylic-appearance=orange][data-acrylic-level="1Level"]{
|
|
86
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground1Level, 0) / 2));
|
|
87
|
+
}
|
|
88
|
+
.widget[data-acrylic-appearance=orange][data-acrylic-level="1Level"] .acrylic{
|
|
89
|
+
opacity:var(--sn-acrylic-opacityBackground1Level, 1);
|
|
90
|
+
background:var(--sn-theme-color-orange-background1Level, var(--sn-primitive-color-orange-95, #fff6e5));
|
|
91
|
+
}
|
|
92
|
+
.widget[data-acrylic-appearance=orange][data-acrylic-level="2Level"]{
|
|
93
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground2Level, 0) / 2));
|
|
94
|
+
}
|
|
95
|
+
.widget[data-acrylic-appearance=orange][data-acrylic-level="2Level"] .acrylic{
|
|
96
|
+
opacity:var(--sn-acrylic-opacityBackground2Level, 1);
|
|
97
|
+
background:var(--sn-theme-color-orange-background2Level, var(--sn-primitive-color-orange-99, #fffcf4));
|
|
98
|
+
}
|
|
99
|
+
.widget[data-acrylic-appearance=yellow][data-acrylic-level=default]{
|
|
100
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground, 0) / 2));
|
|
101
|
+
}
|
|
102
|
+
.widget[data-acrylic-appearance=yellow][data-acrylic-level=default] .acrylic{
|
|
103
|
+
opacity:var(--sn-acrylic-opacityBackground, 1);
|
|
104
|
+
background:var(--sn-theme-color-yellow-background, var(--sn-primitive-color-yellow-90, #fdf4cc));
|
|
105
|
+
}
|
|
106
|
+
.widget[data-acrylic-appearance=yellow][data-acrylic-level="1Level"]{
|
|
107
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground1Level, 0) / 2));
|
|
108
|
+
}
|
|
109
|
+
.widget[data-acrylic-appearance=yellow][data-acrylic-level="1Level"] .acrylic{
|
|
110
|
+
opacity:var(--sn-acrylic-opacityBackground1Level, 1);
|
|
111
|
+
background:var(--sn-theme-color-yellow-background1Level, var(--sn-primitive-color-yellow-95, #fffbe6));
|
|
112
|
+
}
|
|
113
|
+
.widget[data-acrylic-appearance=yellow][data-acrylic-level="2Level"]{
|
|
114
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground2Level, 0) / 2));
|
|
115
|
+
}
|
|
116
|
+
.widget[data-acrylic-appearance=yellow][data-acrylic-level="2Level"] .acrylic{
|
|
117
|
+
opacity:var(--sn-acrylic-opacityBackground2Level, 1);
|
|
118
|
+
background:var(--sn-theme-color-yellow-background2Level, var(--sn-primitive-color-yellow-99, #fffef6));
|
|
119
|
+
}
|
|
120
|
+
.widget[data-acrylic-appearance=green][data-acrylic-level=default]{
|
|
121
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground, 0) / 2));
|
|
122
|
+
}
|
|
123
|
+
.widget[data-acrylic-appearance=green][data-acrylic-level=default] .acrylic{
|
|
124
|
+
opacity:var(--sn-acrylic-opacityBackground, 1);
|
|
125
|
+
background:var(--sn-theme-color-green-background, var(--sn-primitive-color-green-90, #e4f5df));
|
|
126
|
+
}
|
|
127
|
+
.widget[data-acrylic-appearance=green][data-acrylic-level="1Level"]{
|
|
128
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground1Level, 0) / 2));
|
|
129
|
+
}
|
|
130
|
+
.widget[data-acrylic-appearance=green][data-acrylic-level="1Level"] .acrylic{
|
|
131
|
+
opacity:var(--sn-acrylic-opacityBackground1Level, 1);
|
|
132
|
+
background:var(--sn-theme-color-green-background1Level, var(--sn-primitive-color-green-95, #f1faed));
|
|
133
|
+
}
|
|
134
|
+
.widget[data-acrylic-appearance=green][data-acrylic-level="2Level"]{
|
|
135
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground2Level, 0) / 2));
|
|
136
|
+
}
|
|
137
|
+
.widget[data-acrylic-appearance=green][data-acrylic-level="2Level"] .acrylic{
|
|
138
|
+
opacity:var(--sn-acrylic-opacityBackground2Level, 1);
|
|
139
|
+
background:var(--sn-theme-color-green-background2Level, var(--sn-primitive-color-green-99, #fcfefa));
|
|
140
|
+
}
|
|
141
|
+
.widget[data-acrylic-appearance=blue][data-acrylic-level=default]{
|
|
142
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground, 0) / 2));
|
|
143
|
+
}
|
|
144
|
+
.widget[data-acrylic-appearance=blue][data-acrylic-level=default] .acrylic{
|
|
145
|
+
opacity:var(--sn-acrylic-opacityBackground, 1);
|
|
146
|
+
background:var(--sn-theme-color-blue-background, var(--sn-primitive-color-blue-90, #e6f4fd));
|
|
147
|
+
}
|
|
148
|
+
.widget[data-acrylic-appearance=blue][data-acrylic-level="1Level"]{
|
|
149
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground1Level, 0) / 2));
|
|
150
|
+
}
|
|
151
|
+
.widget[data-acrylic-appearance=blue][data-acrylic-level="1Level"] .acrylic{
|
|
152
|
+
opacity:var(--sn-acrylic-opacityBackground1Level, 1);
|
|
153
|
+
background:var(--sn-theme-color-blue-background1Level, var(--sn-primitive-color-blue-95, #f2f9ff));
|
|
154
|
+
}
|
|
155
|
+
.widget[data-acrylic-appearance=blue][data-acrylic-level="2Level"]{
|
|
156
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground2Level, 0) / 2));
|
|
157
|
+
}
|
|
158
|
+
.widget[data-acrylic-appearance=blue][data-acrylic-level="2Level"] .acrylic{
|
|
159
|
+
opacity:var(--sn-acrylic-opacityBackground2Level, 1);
|
|
160
|
+
background:var(--sn-theme-color-blue-background2Level, var(--sn-primitive-color-blue-99, #fdfeff));
|
|
161
|
+
}
|
|
162
|
+
.widget[data-acrylic-appearance=violet][data-acrylic-level=default]{
|
|
163
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground, 0) / 2));
|
|
164
|
+
}
|
|
165
|
+
.widget[data-acrylic-appearance=violet][data-acrylic-level=default] .acrylic{
|
|
166
|
+
opacity:var(--sn-acrylic-opacityBackground, 1);
|
|
167
|
+
background:var(--sn-theme-color-violet-background, var(--sn-primitive-color-violet-90, #f3edfc));
|
|
168
|
+
}
|
|
169
|
+
.widget[data-acrylic-appearance=violet][data-acrylic-level="1Level"]{
|
|
170
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground1Level, 0) / 2));
|
|
171
|
+
}
|
|
172
|
+
.widget[data-acrylic-appearance=violet][data-acrylic-level="1Level"] .acrylic{
|
|
173
|
+
opacity:var(--sn-acrylic-opacityBackground1Level, 1);
|
|
174
|
+
background:var(--sn-theme-color-violet-background1Level, var(--sn-primitive-color-violet-95, #f9f5ff));
|
|
175
|
+
}
|
|
176
|
+
.widget[data-acrylic-appearance=violet][data-acrylic-level="2Level"]{
|
|
177
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground2Level, 0) / 2));
|
|
178
|
+
}
|
|
179
|
+
.widget[data-acrylic-appearance=violet][data-acrylic-level="2Level"] .acrylic{
|
|
180
|
+
opacity:var(--sn-acrylic-opacityBackground2Level, 1);
|
|
181
|
+
background:var(--sn-theme-color-violet-background2Level, var(--sn-primitive-color-violet-99, #fdfdfd));
|
|
182
|
+
}
|
|
183
|
+
.widget[data-acrylic-appearance=pink][data-acrylic-level=default]{
|
|
184
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground, 0) / 2));
|
|
185
|
+
}
|
|
186
|
+
.widget[data-acrylic-appearance=pink][data-acrylic-level=default] .acrylic{
|
|
187
|
+
opacity:var(--sn-acrylic-opacityBackground, 1);
|
|
188
|
+
background:var(--sn-theme-color-pink-background, var(--sn-primitive-color-pink-90, #fceaf0));
|
|
189
|
+
}
|
|
190
|
+
.widget[data-acrylic-appearance=pink][data-acrylic-level="1Level"]{
|
|
191
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground1Level, 0) / 2));
|
|
192
|
+
}
|
|
193
|
+
.widget[data-acrylic-appearance=pink][data-acrylic-level="1Level"] .acrylic{
|
|
194
|
+
opacity:var(--sn-acrylic-opacityBackground1Level, 1);
|
|
195
|
+
background:var(--sn-theme-color-pink-background1Level, var(--sn-primitive-color-pink-95, #fff5f7));
|
|
196
|
+
}
|
|
197
|
+
.widget[data-acrylic-appearance=pink][data-acrylic-level="2Level"]{
|
|
198
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground2Level, 0) / 2));
|
|
199
|
+
}
|
|
200
|
+
.widget[data-acrylic-appearance=pink][data-acrylic-level="2Level"] .acrylic{
|
|
201
|
+
opacity:var(--sn-acrylic-opacityBackground2Level, 1);
|
|
202
|
+
background:var(--sn-theme-color-pink-background2Level, var(--sn-primitive-color-pink-99, #fdfcfc));
|
|
203
|
+
}
|
|
204
|
+
.widget[data-acrylic-appearance=transparent]{
|
|
205
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground1Level, 0) / 2));
|
|
206
|
+
}
|
|
207
|
+
.widget[data-acrylic-appearance=transparent] .acrylic{
|
|
208
|
+
opacity:var(--sn-acrylic-opacityBackground1Level, 1);
|
|
209
|
+
background:transparent;
|
|
210
|
+
}
|
|
211
|
+
.widget[data-acrylic-appearance=decorTransparent]{
|
|
212
|
+
backdrop-filter:blur(calc(var(--sn-acrylic-blurBackground1Level, 0) / 2));
|
|
213
|
+
}
|
|
214
|
+
.widget[data-acrylic-appearance=decorTransparent] .acrylic{
|
|
215
|
+
opacity:var(--sn-acrylic-opacityBackground1Level, 1);
|
|
216
|
+
background:var(--sn-theme-color-neutral-decorTransparent, var(--sn-brand-color-neutral-transparent-forLightMode, rgba(124, 131, 182, 0.0784313725)));
|
|
217
|
+
}
|
|
218
|
+
.widget[data-state=loading][data-wide]{
|
|
219
|
+
gap:var(--sn-primitive-dimension-16, 16px);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.widgetHeader{
|
|
223
|
+
display:flex;
|
|
224
|
+
gap:var(--sn-primitive-dimension-16, 16px);
|
|
225
|
+
align-items:center;
|
|
226
|
+
justify-content:space-between;
|
|
227
|
+
min-width:0;
|
|
228
|
+
}
|
|
229
|
+
.widgetHeader[data-mobile]{
|
|
230
|
+
flex-direction:column;
|
|
231
|
+
align-items:flex-start;
|
|
232
|
+
}
|
|
233
|
+
.widgetHeader[data-loading]{
|
|
234
|
+
gap:var(--sn-primitive-dimension-12, 12px);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.headerMain{
|
|
238
|
+
display:flex;
|
|
239
|
+
flex:0 1 auto;
|
|
240
|
+
gap:var(--sn-primitive-dimension-16, 16px);
|
|
241
|
+
align-items:center;
|
|
242
|
+
justify-content:space-between;
|
|
243
|
+
min-width:0;
|
|
244
|
+
max-width:100%;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.widgetHeader[data-mobile] .headerMain{
|
|
248
|
+
width:100%;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.titleClickable{
|
|
252
|
+
flex:0 1 auto;
|
|
253
|
+
min-width:0;
|
|
254
|
+
max-width:100%;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.widgetContent{
|
|
258
|
+
min-height:0;
|
|
259
|
+
color:var(--sn-theme-color-available-version-textMain, var(--sn-brand-color-text-version-main, #41424e));
|
|
260
|
+
font-family:var(--sn-regular-body-s-fontFamily, var(--sn-brand-font-fontFamily-regular-body, var(--sn-primitive-fontFamily-brandA-sans, SB Sans Interface)));
|
|
261
|
+
font-weight:var(--sn-regular-body-s-fontWeight, var(--sn-theme-typography-fontWeight-regular-body-s, var(--sn-brand-font-fontWeight-light-regular-body-s, var(--sn-primitive-font-fontWeightValue-400, 400))));
|
|
262
|
+
line-height:var(--sn-regular-body-s-lineHeight, var(--sn-density-typography-roleBody-lineHeightS, var(--sn-primitive-font-lineHeight-by14, 20px)));
|
|
263
|
+
font-size:var(--sn-regular-body-s-fontSize, var(--sn-density-typography-roleBody-fontSizeS, var(--sn-primitive-font-fontSize-14, 14px)));
|
|
264
|
+
letter-spacing:var(--sn-regular-body-s-letterSpacing, var(--sn-primitive-font-letterSpacing-m, 0.1px));
|
|
265
|
+
paragraph-spacing:var(--sn-regular-body-s-paragraphSpacing, var(--sn-primitive-font-paragraphSpacing-byFontSize12, 6px));
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.skeletonHeader{
|
|
269
|
+
flex:1;
|
|
270
|
+
width:100%;
|
|
271
|
+
min-width:0;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.button{
|
|
275
|
+
white-space:nowrap;
|
|
276
|
+
}
|
|
277
|
+
.button[data-full-width]:not([data-variant=icon-only]){
|
|
278
|
+
flex-shrink:0;
|
|
279
|
+
width:auto;
|
|
280
|
+
}
|
|
281
|
+
.button[data-variant=icon-only]{
|
|
282
|
+
flex-grow:0;
|
|
283
|
+
flex-shrink:0;
|
|
284
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Widget';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Widget"), exports);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const WIDGET_STATE: {
|
|
2
|
+
readonly Default: "default";
|
|
3
|
+
readonly Loading: "loading";
|
|
4
|
+
readonly Error: "error";
|
|
5
|
+
};
|
|
6
|
+
export declare const BUTTON_TYPE: {
|
|
7
|
+
readonly Filled: "filled";
|
|
8
|
+
readonly Outline: "outline";
|
|
9
|
+
readonly Tonal: "tonal";
|
|
10
|
+
readonly Function: "function";
|
|
11
|
+
readonly Simple: "simple";
|
|
12
|
+
readonly Droplist: "droplist";
|
|
13
|
+
readonly Kebab: "kebab";
|
|
14
|
+
};
|
|
15
|
+
export declare const TEST_IDS: {
|
|
16
|
+
readonly root: "widget";
|
|
17
|
+
readonly header: "widget-header";
|
|
18
|
+
readonly content: "widget-content";
|
|
19
|
+
readonly actions: "widget-actions";
|
|
20
|
+
readonly control: "widget-control";
|
|
21
|
+
readonly kebabButton: "widget-kebab-button";
|
|
22
|
+
readonly kebabDroplist: "widget-kebab-droplist";
|
|
23
|
+
readonly dropdown: "widget-dropdown";
|
|
24
|
+
readonly errorRetry: "widget-error-retry";
|
|
25
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TEST_IDS = exports.BUTTON_TYPE = exports.WIDGET_STATE = void 0;
|
|
4
|
+
exports.WIDGET_STATE = {
|
|
5
|
+
Default: 'default',
|
|
6
|
+
Loading: 'loading',
|
|
7
|
+
Error: 'error',
|
|
8
|
+
};
|
|
9
|
+
exports.BUTTON_TYPE = {
|
|
10
|
+
Filled: 'filled',
|
|
11
|
+
Outline: 'outline',
|
|
12
|
+
Tonal: 'tonal',
|
|
13
|
+
Function: 'function',
|
|
14
|
+
Simple: 'simple',
|
|
15
|
+
Droplist: 'droplist',
|
|
16
|
+
Kebab: 'kebab',
|
|
17
|
+
};
|
|
18
|
+
exports.TEST_IDS = {
|
|
19
|
+
root: 'widget',
|
|
20
|
+
header: 'widget-header',
|
|
21
|
+
content: 'widget-content',
|
|
22
|
+
actions: 'widget-actions',
|
|
23
|
+
control: 'widget-control',
|
|
24
|
+
kebabButton: 'widget-kebab-button',
|
|
25
|
+
kebabDroplist: 'widget-kebab-droplist',
|
|
26
|
+
dropdown: 'widget-dropdown',
|
|
27
|
+
errorRetry: 'widget-error-retry',
|
|
28
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { WidgetAction } from '../../types';
|
|
2
|
+
type ActionViewProps = WidgetAction & {
|
|
3
|
+
commonProps?: {
|
|
4
|
+
className?: string;
|
|
5
|
+
size?: 's' | 'm' | 'l';
|
|
6
|
+
fullWidth?: boolean;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export declare const ActionView: import("react").NamedExoticComponent<ActionViewProps>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ActionView = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const button_1 = require("@cloud-ru/ds-button");
|
|
6
|
+
const tooltip_1 = require("@cloud-ru/ds-tooltip");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const constants_1 = require("../../constants");
|
|
9
|
+
const ButtonDroplist_1 = require("../ButtonDroplist");
|
|
10
|
+
const ButtonKebab_1 = require("../ButtonKebab");
|
|
11
|
+
function withTooltip(children, tooltip) {
|
|
12
|
+
return tooltip ? (0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { ...tooltip, children: children }) : children;
|
|
13
|
+
}
|
|
14
|
+
function ActionViewComponent({ variant = constants_1.BUTTON_TYPE.Filled, tooltip, hidden = false, commonProps, ...rest }) {
|
|
15
|
+
if (hidden) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
switch (variant) {
|
|
19
|
+
case constants_1.BUTTON_TYPE.Outline:
|
|
20
|
+
return withTooltip((0, jsx_runtime_1.jsx)(button_1.Button, { ...rest, ...commonProps, view: button_1.VIEW.Outline }), tooltip);
|
|
21
|
+
case constants_1.BUTTON_TYPE.Tonal:
|
|
22
|
+
return withTooltip((0, jsx_runtime_1.jsx)(button_1.Button, { ...rest, ...commonProps, view: button_1.VIEW.Tonal }), tooltip);
|
|
23
|
+
case constants_1.BUTTON_TYPE.Function:
|
|
24
|
+
return withTooltip((0, jsx_runtime_1.jsx)(button_1.Button, { ...rest, ...commonProps, view: button_1.VIEW.Function }), tooltip);
|
|
25
|
+
case constants_1.BUTTON_TYPE.Simple:
|
|
26
|
+
return withTooltip((0, jsx_runtime_1.jsx)(button_1.Button, { ...rest, ...commonProps, view: button_1.VIEW.Simple }), tooltip);
|
|
27
|
+
case constants_1.BUTTON_TYPE.Kebab: {
|
|
28
|
+
const { button, list } = rest;
|
|
29
|
+
return withTooltip((0, jsx_runtime_1.jsx)(ButtonKebab_1.ButtonKebab, { button: { ...button, ...commonProps }, list: list }), tooltip);
|
|
30
|
+
}
|
|
31
|
+
case constants_1.BUTTON_TYPE.Droplist: {
|
|
32
|
+
const { button, list } = rest;
|
|
33
|
+
return withTooltip((0, jsx_runtime_1.jsx)(ButtonDroplist_1.ButtonDroplist, { button: { ...button, ...commonProps }, list: list }), tooltip);
|
|
34
|
+
}
|
|
35
|
+
case constants_1.BUTTON_TYPE.Filled:
|
|
36
|
+
default:
|
|
37
|
+
return withTooltip((0, jsx_runtime_1.jsx)(button_1.Button, { ...rest, ...commonProps, view: button_1.VIEW.Filled }), tooltip);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.ActionView = (0, react_1.memo)(ActionViewComponent);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { WidgetAction, WidgetState } from '../../types';
|
|
3
|
+
type ActionsProps = {
|
|
4
|
+
actions?: WidgetAction[];
|
|
5
|
+
actionsChildren?: ReactNode;
|
|
6
|
+
wide?: boolean;
|
|
7
|
+
state?: WidgetState;
|
|
8
|
+
fullWidthPrimaryAction?: boolean;
|
|
9
|
+
showOverflowActions?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const Actions: import("react").NamedExoticComponent<ActionsProps>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Actions = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const skeleton_1 = require("@cloud-ru/ds-skeleton");
|
|
9
|
+
const react_1 = require("react");
|
|
10
|
+
const constants_1 = require("../../constants");
|
|
11
|
+
const ButtonKebab_1 = require("../ButtonKebab");
|
|
12
|
+
const ActionView_1 = require("./ActionView");
|
|
13
|
+
const helpers_1 = require("./helpers");
|
|
14
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
15
|
+
function ActionsSkeleton({ wide }) {
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.actionsWrapper, "data-wide": wide || undefined, children: (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.skeletonActions, children: wide ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { loading: true, width: '96px', height: '32px', borderRadius: '8px' }), (0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { loading: true, width: '32px', height: '32px', borderRadius: '8px' })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.skeletonActionFull, children: (0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { loading: true, width: '100%', height: '32px', borderRadius: '8px' }) }), (0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { loading: true, width: '32px', height: '32px', borderRadius: '8px' })] })) }) }));
|
|
17
|
+
}
|
|
18
|
+
function ActionsComponent({ actions = [], actionsChildren, wide, state }) {
|
|
19
|
+
const { action: primaryAction, index: primaryActionIndex } = (0, react_1.useMemo)(() => (0, helpers_1.getPrimaryAction)(actions), [actions]);
|
|
20
|
+
const kebabItems = (0, react_1.useMemo)(() => {
|
|
21
|
+
const items = (0, helpers_1.buildKebabItems)(actions, primaryActionIndex);
|
|
22
|
+
if (!wide && primaryAction) {
|
|
23
|
+
items.unshift((0, helpers_1.actionToListItem)(primaryAction));
|
|
24
|
+
}
|
|
25
|
+
return items.map(item => 'type' in item
|
|
26
|
+
? item
|
|
27
|
+
: {
|
|
28
|
+
...item,
|
|
29
|
+
onClick: (event) => item.onClick?.(event),
|
|
30
|
+
});
|
|
31
|
+
}, [primaryAction, wide, actions, primaryActionIndex]);
|
|
32
|
+
if (state === 'loading') {
|
|
33
|
+
return (0, jsx_runtime_1.jsx)(ActionsSkeleton, { wide: wide });
|
|
34
|
+
}
|
|
35
|
+
if (!(0, helpers_1.hasVisibleActions)(actions) && !actionsChildren) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.actionsWrapper, "data-test-id": constants_1.TEST_IDS.actions, children: [actionsChildren, primaryAction && wide && (0, jsx_runtime_1.jsx)(ActionView_1.ActionView, { ...primaryAction, commonProps: { size: 'm', fullWidth: true } }), Boolean(kebabItems.length) && ((0, jsx_runtime_1.jsx)(ButtonKebab_1.ButtonKebab, { list: {
|
|
39
|
+
items: kebabItems,
|
|
40
|
+
closeDroplistOnItemClick: true,
|
|
41
|
+
} }))] }));
|
|
42
|
+
}
|
|
43
|
+
exports.Actions = (0, react_1.memo)(ActionsComponent);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { MouseEvent } from 'react';
|
|
2
|
+
import { WidgetAction, WidgetActionListEntry } from '../../types';
|
|
3
|
+
export declare function isVisibleAction(action: WidgetAction): boolean;
|
|
4
|
+
export declare function hasVisibleActions(actions: WidgetAction[]): boolean;
|
|
5
|
+
export declare function actionToListItem(action: WidgetAction, close?: () => void): {
|
|
6
|
+
content: {
|
|
7
|
+
label: string;
|
|
8
|
+
};
|
|
9
|
+
beforeContent: import("react").ReactNode;
|
|
10
|
+
tooltip: import("@cloud-ru/ds-tooltip").TooltipProps | undefined;
|
|
11
|
+
disabled: boolean | undefined;
|
|
12
|
+
onClick: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
13
|
+
};
|
|
14
|
+
export declare function getPrimaryAction(items: WidgetAction[]): {
|
|
15
|
+
action: import("../../types").Action;
|
|
16
|
+
index: number;
|
|
17
|
+
} | {
|
|
18
|
+
index: number;
|
|
19
|
+
action?: undefined;
|
|
20
|
+
};
|
|
21
|
+
export declare function buildKebabItems(items: WidgetAction[], primaryActionIndex: number): WidgetActionListEntry[];
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isVisibleAction = isVisibleAction;
|
|
4
|
+
exports.hasVisibleActions = hasVisibleActions;
|
|
5
|
+
exports.actionToListItem = actionToListItem;
|
|
6
|
+
exports.getPrimaryAction = getPrimaryAction;
|
|
7
|
+
exports.buildKebabItems = buildKebabItems;
|
|
8
|
+
const constants_1 = require("../../constants");
|
|
9
|
+
function isVisibleAction(action) {
|
|
10
|
+
return !action.hidden;
|
|
11
|
+
}
|
|
12
|
+
function hasVisibleActions(actions) {
|
|
13
|
+
return actions.some(isVisibleAction);
|
|
14
|
+
}
|
|
15
|
+
function actionToListItem(action, close) {
|
|
16
|
+
const { label = '', icon, onClick, disabled, tooltip, } = action;
|
|
17
|
+
return {
|
|
18
|
+
content: { label: label },
|
|
19
|
+
beforeContent: icon,
|
|
20
|
+
tooltip,
|
|
21
|
+
disabled,
|
|
22
|
+
onClick: (event) => {
|
|
23
|
+
close?.();
|
|
24
|
+
onClick?.(event);
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function getPrimaryAction(items) {
|
|
29
|
+
const index = items.findIndex(action => isVisibleAction(action) &&
|
|
30
|
+
action.variant !== constants_1.BUTTON_TYPE.Function &&
|
|
31
|
+
action.variant !== constants_1.BUTTON_TYPE.Droplist &&
|
|
32
|
+
action.variant !== constants_1.BUTTON_TYPE.Kebab);
|
|
33
|
+
return index >= 0 ? { action: items[index], index } : { index: -1 };
|
|
34
|
+
}
|
|
35
|
+
function buildKebabItems(items, primaryActionIndex) {
|
|
36
|
+
return items.reduce((acc, action, index) => {
|
|
37
|
+
if (!isVisibleAction(action)) {
|
|
38
|
+
return acc;
|
|
39
|
+
}
|
|
40
|
+
if (action.variant === constants_1.BUTTON_TYPE.Function) {
|
|
41
|
+
return acc;
|
|
42
|
+
}
|
|
43
|
+
if (action.variant === constants_1.BUTTON_TYPE.Droplist || action.variant === constants_1.BUTTON_TYPE.Kebab) {
|
|
44
|
+
acc.push({
|
|
45
|
+
type: 'group',
|
|
46
|
+
label: action.variant === constants_1.BUTTON_TYPE.Droplist ? action.button.label : undefined,
|
|
47
|
+
items: action.list.items.flatMap(item => ('type' in item ? item.items : [item])),
|
|
48
|
+
divider: acc.length > 0,
|
|
49
|
+
});
|
|
50
|
+
return acc;
|
|
51
|
+
}
|
|
52
|
+
if (index !== primaryActionIndex) {
|
|
53
|
+
acc.push(actionToListItem(action, () => undefined));
|
|
54
|
+
}
|
|
55
|
+
return acc;
|
|
56
|
+
}, []);
|
|
57
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.isVisibleAction = void 0;
|
|
18
|
+
__exportStar(require("./Actions"), exports);
|
|
19
|
+
__exportStar(require("./ActionView"), exports);
|
|
20
|
+
var helpers_1 = require("./helpers");
|
|
21
|
+
Object.defineProperty(exports, "isVisibleAction", { enumerable: true, get: function () { return helpers_1.isVisibleAction; } });
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
.mobileActionsWrapper{
|
|
2
|
+
scrollbar-width:none;
|
|
3
|
+
overflow-y:auto;
|
|
4
|
+
display:flex;
|
|
5
|
+
flex-shrink:0;
|
|
6
|
+
gap:var(--sn-primitive-dimension-8, 8px);
|
|
7
|
+
justify-content:stretch;
|
|
8
|
+
width:100%;
|
|
9
|
+
}
|
|
10
|
+
.mobileActionsWrapper::-webkit-scrollbar{
|
|
11
|
+
display:none;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.button{
|
|
15
|
+
white-space:nowrap;
|
|
16
|
+
}
|
|
17
|
+
.button[data-full-width]:not([data-variant=icon-only]){
|
|
18
|
+
flex-shrink:0;
|
|
19
|
+
width:auto;
|
|
20
|
+
}
|
|
21
|
+
.button[data-variant=icon-only]{
|
|
22
|
+
flex-grow:0;
|
|
23
|
+
flex-shrink:0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.actionsWrapper{
|
|
27
|
+
display:flex;
|
|
28
|
+
flex-shrink:0;
|
|
29
|
+
gap:var(--sn-primitive-dimension-8, 8px);
|
|
30
|
+
align-items:center;
|
|
31
|
+
}
|
|
32
|
+
.actionsWrapper[data-wide]{
|
|
33
|
+
justify-content:flex-end;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.skeletonActions{
|
|
37
|
+
display:flex;
|
|
38
|
+
gap:var(--sn-primitive-dimension-8, 8px);
|
|
39
|
+
align-items:center;
|
|
40
|
+
width:100%;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.skeletonActionFull{
|
|
44
|
+
flex:1;
|
|
45
|
+
min-width:0;
|
|
46
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { WidgetActionListEntry } from '../../types';
|
|
2
|
+
type ActionListProps = {
|
|
3
|
+
items: WidgetActionListEntry[];
|
|
4
|
+
className?: string;
|
|
5
|
+
closeOnItemClick?: boolean;
|
|
6
|
+
onItemClick?: () => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const ActionList: import("react").NamedExoticComponent<ActionListProps>;
|
|
9
|
+
export {};
|