@wisdomgarden/torque 0.2.2 → 0.2.4
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/_inner/drawer/base-bottom-drawer.d.ts +1 -1
- package/dist/components/_inner/drawer/base-bottom-drawer.js +52 -44
- package/dist/components/_inner/menu/_web/menu.web.js +83 -72
- package/dist/components/_inner/portal/index.d.ts +1 -0
- package/dist/components/_inner/portal/index.js +5 -0
- package/dist/components/_inner/portal/portal.d.ts +14 -0
- package/dist/components/_inner/portal/portal.js +19 -0
- package/dist/components/button/styles/button-variables.module.css.js +1 -1
- package/dist/components/drawer/drawer.d.ts +1 -1
- package/dist/components/drawer/drawer.js +42 -34
- package/dist/components/modal/index.d.ts +1 -1
- package/dist/components/modal/modal.d.ts +7 -4
- package/dist/components/modal/modal.js +191 -44
- package/dist/components/modal/modal.module.css.js +20 -6
- package/dist/components/modal/modal.types.d.ts +96 -0
- package/dist/components/modal-deprecated/index.d.ts +2 -0
- package/dist/components/modal-deprecated/index.js +5 -0
- package/dist/components/modal-deprecated/modal-deprecated.d.ts +11 -0
- package/dist/components/modal-deprecated/modal-deprecated.js +70 -0
- package/dist/components/modal-deprecated/modal-deprecated.module.css.js +10 -0
- package/dist/components/notifications/index.d.ts +2 -0
- package/dist/components/notifications/index.js +4 -2
- package/dist/components/notifications/notifications-container.d.ts +9 -0
- package/dist/components/notifications/notifications-container.js +22 -0
- package/dist/components/overlay-layer/constants.d.ts +15 -0
- package/dist/components/overlay-layer/constants.js +8 -0
- package/dist/components/overlay-layer/index.d.ts +5 -0
- package/dist/components/overlay-layer/index.js +11 -0
- package/dist/components/overlay-layer/overlay-parent-context.d.ts +6 -0
- package/dist/components/overlay-layer/overlay-parent-context.js +18 -0
- package/dist/components/overlay-layer/overlay-stack-debug.d.ts +24 -0
- package/dist/components/overlay-layer/overlay-stack-debug.js +151 -0
- package/dist/components/overlay-layer/overlay-stack.d.ts +38 -0
- package/dist/components/overlay-layer/overlay-stack.js +137 -0
- package/dist/components/overlay-layer/overlay-tier-scope.d.ts +12 -0
- package/dist/components/overlay-layer/overlay-tier-scope.js +16 -0
- package/dist/components/overlay-layer/types.d.ts +63 -0
- package/dist/components/overlay-layer/use-mantine-overlay-layer.d.ts +21 -0
- package/dist/components/overlay-layer/use-mantine-overlay-layer.js +24 -0
- package/dist/components/overlay-layer/use-overlay-layer.d.ts +26 -0
- package/dist/components/overlay-layer/use-overlay-layer.js +77 -0
- package/dist/components/popover/hooks.d.ts +0 -1
- package/dist/components/popover/hooks.js +69 -83
- package/dist/components/popover/popover-context.d.ts +0 -1
- package/dist/components/popover/popover-context.js +3 -4
- package/dist/components/popover/popover-dropdown.js +110 -91
- package/dist/components/popover/popover.js +134 -150
- package/dist/components/popover/popover.types.d.ts +7 -3
- package/dist/components/tooltip/index.d.ts +10 -2
- package/dist/components/tooltip/index.js +100 -92
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +197 -185
- package/dist/provider/ui-context.d.ts +10 -0
- package/dist/provider/ui-context.js +8 -7
- package/dist/provider/ui-provider.d.ts +23 -1
- package/dist/provider/ui-provider.js +17 -10
- package/package.json +3 -3
- package/dist/components/popover/popover-stack.d.ts +0 -10
- package/dist/components/popover/popover-stack.js +0 -24
package/dist/index.js
CHANGED
|
@@ -7,208 +7,220 @@ import { useCssVariableValues as n } from "./common/use-css-variable-values.js";
|
|
|
7
7
|
import { comboboxTransitionProps as s } from "./common/util.js";
|
|
8
8
|
export * from "@wisdomgarden/torque-icons";
|
|
9
9
|
import { formatTemplate as c } from "./locale/types.js";
|
|
10
|
-
import { zhHans as
|
|
11
|
-
import { en as
|
|
12
|
-
import { zhHant as
|
|
13
|
-
import { ar as
|
|
10
|
+
import { zhHans as d } from "./locale/zh-Hans.js";
|
|
11
|
+
import { en as C } from "./locale/en.js";
|
|
12
|
+
import { zhHant as I } from "./locale/zh-Hant.js";
|
|
13
|
+
import { ar as S } from "./locale/ar.js";
|
|
14
14
|
import { ko as F } from "./locale/ko.js";
|
|
15
|
-
import { UiContext as
|
|
16
|
-
import { DefaultUiLink as
|
|
17
|
-
import { UiProvider as
|
|
18
|
-
import { useCheckDevice as
|
|
19
|
-
import { Button as
|
|
20
|
-
import { IconButton as
|
|
21
|
-
import { LinkButton as
|
|
22
|
-
import { LinkIconButton as
|
|
23
|
-
import { Tooltip as
|
|
24
|
-
import { Popover as
|
|
25
|
-
import { Drawer as
|
|
15
|
+
import { UiContext as L, uiContextDefaultValue as R } from "./provider/ui-context.js";
|
|
16
|
+
import { DefaultUiLink as h } from "./provider/ui-link.js";
|
|
17
|
+
import { UiProvider as w } from "./provider/ui-provider.js";
|
|
18
|
+
import { useCheckDevice as M, useDeviceType as N, useLocale as O, useUiContext as y, useUiLink as H } from "./provider/hooks.js";
|
|
19
|
+
import { Button as E } from "./components/button/button.js";
|
|
20
|
+
import { IconButton as _ } from "./components/icon-button/icon-button.js";
|
|
21
|
+
import { LinkButton as z } from "./components/link-button/link-button.js";
|
|
22
|
+
import { LinkIconButton as j } from "./components/link-icon-button/link-icon-button.js";
|
|
23
|
+
import { Tooltip as J } from "./components/tooltip/index.js";
|
|
24
|
+
import { Popover as Q } from "./components/popover/index.js";
|
|
25
|
+
import { Drawer as Z } from "./components/drawer/drawer.js";
|
|
26
26
|
import { drawers as oo } from "./components/drawer/drawer-events.js";
|
|
27
27
|
import { DrawerManager as eo } from "./components/drawer/drawes.js";
|
|
28
28
|
import { BottomDrawer as po } from "./components/bottom-drawer/bottom-drawer.js";
|
|
29
29
|
import { Modal as xo } from "./components/modal/modal.js";
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
83
|
-
import {
|
|
84
|
-
import {
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
88
|
-
import {
|
|
89
|
-
import {
|
|
90
|
-
import {
|
|
91
|
-
import {
|
|
92
|
-
import {
|
|
93
|
-
import {
|
|
94
|
-
import {
|
|
95
|
-
import {
|
|
96
|
-
import {
|
|
97
|
-
import {
|
|
98
|
-
import {
|
|
99
|
-
import {
|
|
100
|
-
import {
|
|
101
|
-
import {
|
|
30
|
+
import { ModalDeprecated as ao } from "./components/modal-deprecated/modal-deprecated.js";
|
|
31
|
+
import { useOverlayLayer as no } from "./components/overlay-layer/use-overlay-layer.js";
|
|
32
|
+
import { OverlayTierScope as so } from "./components/overlay-layer/overlay-tier-scope.js";
|
|
33
|
+
import { OVERLAY_BASE as To, OVERLAY_TIER_NOTIFICATION as co, OVERLAY_TOP_MIN as bo } from "./components/overlay-layer/constants.js";
|
|
34
|
+
import { Menu as Co } from "./components/menu/menu.js";
|
|
35
|
+
import { messages as Io } from "./components/message/messages.js";
|
|
36
|
+
import { notifications as So } from "./components/notifications/notifications.js";
|
|
37
|
+
import { Notification as Fo } from "./components/notifications/notification.js";
|
|
38
|
+
import { NotificationsContainer as Lo } from "./components/notifications/notifications-container.js";
|
|
39
|
+
import { Alert as vo, AlertSkeleton as ho } from "./components/alert/alert.js";
|
|
40
|
+
import { StickyBox as wo } from "./components/sticky-box.js";
|
|
41
|
+
import { Tag as Mo } from "./components/tag/tag.js";
|
|
42
|
+
import { ClosableTag as Oo } from "./components/tag/closable-tag.js";
|
|
43
|
+
import { IconTag as Ho } from "./components/tag/icon-tag.js";
|
|
44
|
+
import { LinkTag as Eo } from "./components/tag/link-tag.js";
|
|
45
|
+
import { Tabs as _o } from "./components/tab/tabs.js";
|
|
46
|
+
import { TabsTab as zo } from "./components/tab/subs/tabs-tab.js";
|
|
47
|
+
import { TabsPanel as jo } from "./components/tab/subs/tabs-panel.js";
|
|
48
|
+
import { TabsList as Jo } from "./components/tab/subs/tabs-list.js";
|
|
49
|
+
import { TabsLinkTab as Qo } from "./components/tab/subs/tabs-link-tab.js";
|
|
50
|
+
import { Table as Zo, TableSkeleton as $o } from "./components/table/table.js";
|
|
51
|
+
import { TableHeaderTitle as rr } from "./components/_inner/table/table-header-title.js";
|
|
52
|
+
import { TableHeadSort as tr } from "./components/_inner/table/head/table-head-sort.js";
|
|
53
|
+
import { TableHeadFilterSingleSelect as mr } from "./components/_inner/table/head/table-head-filter-single-select.js";
|
|
54
|
+
import { TableHeadFilterMultiSelect as fr } from "./components/_inner/table/head/table-head-filter-multi-select.js";
|
|
55
|
+
import { TableHeadFilterSearch as ir } from "./components/_inner/table/head/table-head-filter-search.js";
|
|
56
|
+
import { Pagination as lr, getPaginationRange as sr } from "./components/table-pagination/pagination.js";
|
|
57
|
+
import { TablePagination as Tr } from "./components/table-pagination/table-pagination.js";
|
|
58
|
+
import { TreeContextProvider as br, useTreeContext as dr } from "./components/tree/tree-context.js";
|
|
59
|
+
import { TreeNode as Cr } from "./components/tree/tree-node.js";
|
|
60
|
+
import { TreeNodeList as Ir } from "./components/tree/tree-node-list.js";
|
|
61
|
+
import { TreeContent as Sr } from "./components/tree/tree-content.js";
|
|
62
|
+
import { Tree as Fr } from "./components/tree/tree.js";
|
|
63
|
+
import { useTree as Lr } from "./components/tree/hooks/use-tree.js";
|
|
64
|
+
import { TreeSelect as vr } from "./components/tree-select/tree-select.js";
|
|
65
|
+
import { VirtualizedTreeSelect as Vr } from "./components/virtualized-tree-select/virtualized-tree-select.js";
|
|
66
|
+
import { DatePicker as Ar } from "./components/date-picker/date-picker.js";
|
|
67
|
+
import { DateRangePicker as Nr } from "./components/date-picker/date-range-picker.js";
|
|
68
|
+
import { TimePicker as yr } from "./components/date-picker/time-picker.js";
|
|
69
|
+
import { TimeRangePicker as Ur } from "./components/date-picker/time-range-picker.js";
|
|
70
|
+
import { DateTimePicker as Wr } from "./components/date-picker/date-time-picker.js";
|
|
71
|
+
import { DateTimeRangePicker as Gr } from "./components/date-picker/date-time-range-picker.js";
|
|
72
|
+
import { Filter as Yr } from "./components/filter/filter.js";
|
|
73
|
+
import { IconFilter as qr } from "./components/filter/icon-filter.js";
|
|
74
|
+
import { MultiFilter as Kr } from "./components/filter/multi-filter.js";
|
|
75
|
+
import { DataFilter as Xr } from "./components/data-filter/data-filter.js";
|
|
76
|
+
import { FilterConditionTags as $r } from "./components/data-filter/filter-condition-tags/filter-condition-tags.js";
|
|
77
|
+
import { BaseInput as re } from "./components/base-input/base-input.js";
|
|
78
|
+
import { BaseInputWrapper as te } from "./components/base-input/subs/base-input-wrapper.js";
|
|
79
|
+
import { BaseInputTarget as me } from "./components/base-input/subs/base-input-target.js";
|
|
80
|
+
import { getFormProps as fe } from "./components/base-input/util.js";
|
|
81
|
+
import { FormItemWrapper as ie } from "./components/form-wrapper/form-item-wrapper.js";
|
|
82
|
+
import { FormItemWrapperDefaultsProvider as le, useFormItemWrapperDefaults as se } from "./components/form-wrapper/form-item-wrapper-defaults-context.js";
|
|
83
|
+
import { TextInput as Te } from "./components/text-input/text-input.js";
|
|
84
|
+
import { TextArea as be } from "./components/text-area/text-area.js";
|
|
85
|
+
import { NumberInput as ke } from "./components/number-input/number-input.js";
|
|
86
|
+
import { PasswordInput as Pe } from "./components/password-input/password-input.js";
|
|
87
|
+
import { Checkbox as ge } from "./components/checkbox/checkbox.js";
|
|
88
|
+
import { CheckboxContext as De, CheckboxGroup as Fe } from "./components/checkbox/checkbox-group.js";
|
|
89
|
+
import { Radio as Le } from "./components/radio/index.js";
|
|
90
|
+
import { Switch as ve } from "./components/switch/switch.js";
|
|
91
|
+
import { SwitchGroup as Ve } from "./components/switch/switch-group.js";
|
|
92
|
+
import { Select as Ae } from "./components/select/select.js";
|
|
93
|
+
import { MultiSelect as Ne } from "./components/multi-select/multi-select.js";
|
|
94
|
+
import { Combobox as ye } from "./components/combobox/combobox.js";
|
|
95
|
+
import { useComboboxContext as Ue } from "./components/combobox/combobox-context.js";
|
|
96
|
+
import { useCombobox as We } from "./components/combobox/hooks/use-combobox.js";
|
|
97
|
+
import { Box as Ge } from "./components/box/box.js";
|
|
98
|
+
import { Text as Ye } from "./components/text/text.js";
|
|
99
|
+
import { Flex as qe } from "./components/flex/flex.js";
|
|
100
|
+
import { Group as Ke } from "./components/group/group.js";
|
|
101
|
+
import { Stack as Xe } from "./components/stack/stack.js";
|
|
102
|
+
import { Paper as $e } from "./components/paper/paper.js";
|
|
103
|
+
import { UnstyledButton as rt } from "./components/unstyled-button/unstyled-button.js";
|
|
104
|
+
import { PopoverDropdown as tt } from "./components/popover/popover-dropdown.js";
|
|
105
|
+
import { PopoverTarget as mt } from "./components/popover/popover-target.js";
|
|
106
|
+
import { RadioGroup as ft, useRadioContext as at } from "./components/radio/radio-group.js";
|
|
102
107
|
export {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
+
vo as Alert,
|
|
109
|
+
ho as AlertSkeleton,
|
|
110
|
+
re as BaseInput,
|
|
111
|
+
me as BaseInputTarget,
|
|
112
|
+
te as BaseInputWrapper,
|
|
108
113
|
po as BottomDrawer,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
114
|
+
Ge as Box,
|
|
115
|
+
E as Button,
|
|
116
|
+
ge as Checkbox,
|
|
117
|
+
De as CheckboxContext,
|
|
118
|
+
Fe as CheckboxGroup,
|
|
119
|
+
Oo as ClosableTag,
|
|
120
|
+
ye as Combobox,
|
|
121
|
+
Xr as DataFilter,
|
|
122
|
+
Ar as DatePicker,
|
|
123
|
+
Nr as DateRangePicker,
|
|
124
|
+
Wr as DateTimePicker,
|
|
125
|
+
Gr as DateTimeRangePicker,
|
|
126
|
+
h as DefaultUiLink,
|
|
127
|
+
Z as Drawer,
|
|
123
128
|
eo as DrawerManager,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
129
|
+
Yr as Filter,
|
|
130
|
+
$r as FilterConditionTags,
|
|
131
|
+
qe as Flex,
|
|
132
|
+
ie as FormItemWrapper,
|
|
133
|
+
le as FormItemWrapperDefaultsProvider,
|
|
134
|
+
Ke as Group,
|
|
135
|
+
_ as IconButton,
|
|
136
|
+
qr as IconFilter,
|
|
137
|
+
Ho as IconTag,
|
|
138
|
+
z as LinkButton,
|
|
139
|
+
j as LinkIconButton,
|
|
140
|
+
Eo as LinkTag,
|
|
141
|
+
Co as Menu,
|
|
137
142
|
xo as Modal,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
143
|
+
ao as ModalDeprecated,
|
|
144
|
+
Kr as MultiFilter,
|
|
145
|
+
Ne as MultiSelect,
|
|
146
|
+
Fo as Notification,
|
|
147
|
+
Lo as NotificationsContainer,
|
|
148
|
+
ke as NumberInput,
|
|
149
|
+
To as OVERLAY_BASE,
|
|
150
|
+
co as OVERLAY_TIER_NOTIFICATION,
|
|
151
|
+
bo as OVERLAY_TOP_MIN,
|
|
152
|
+
so as OverlayTierScope,
|
|
153
|
+
lr as Pagination,
|
|
154
|
+
$e as Paper,
|
|
155
|
+
Pe as PasswordInput,
|
|
156
|
+
Q as Popover,
|
|
157
|
+
tt as PopoverDropdown,
|
|
158
|
+
mt as PopoverTarget,
|
|
159
|
+
Le as Radio,
|
|
160
|
+
ft as RadioGroup,
|
|
161
|
+
Ae as Select,
|
|
162
|
+
Xe as Stack,
|
|
163
|
+
wo as StickyBox,
|
|
164
|
+
ve as Switch,
|
|
165
|
+
Ve as SwitchGroup,
|
|
166
|
+
Zo as Table,
|
|
167
|
+
fr as TableHeadFilterMultiSelect,
|
|
168
|
+
ir as TableHeadFilterSearch,
|
|
169
|
+
mr as TableHeadFilterSingleSelect,
|
|
170
|
+
tr as TableHeadSort,
|
|
171
|
+
rr as TableHeaderTitle,
|
|
172
|
+
Tr as TablePagination,
|
|
173
|
+
$o as TableSkeleton,
|
|
174
|
+
_o as Tabs,
|
|
175
|
+
Qo as TabsLinkTab,
|
|
176
|
+
Jo as TabsList,
|
|
177
|
+
jo as TabsPanel,
|
|
178
|
+
zo as TabsTab,
|
|
179
|
+
Mo as Tag,
|
|
180
|
+
Ye as Text,
|
|
181
|
+
be as TextArea,
|
|
182
|
+
Te as TextInput,
|
|
183
|
+
yr as TimePicker,
|
|
184
|
+
Ur as TimeRangePicker,
|
|
185
|
+
J as Tooltip,
|
|
186
|
+
Fr as Tree,
|
|
187
|
+
Sr as TreeContent,
|
|
188
|
+
br as TreeContextProvider,
|
|
189
|
+
Cr as TreeNode,
|
|
190
|
+
Ir as TreeNodeList,
|
|
191
|
+
vr as TreeSelect,
|
|
192
|
+
L as UiContext,
|
|
193
|
+
w as UiProvider,
|
|
194
|
+
rt as UnstyledButton,
|
|
195
|
+
Vr as VirtualizedTreeSelect,
|
|
196
|
+
S as ar,
|
|
186
197
|
s as comboboxTransitionProps,
|
|
187
198
|
oo as drawers,
|
|
188
|
-
|
|
199
|
+
C as en,
|
|
189
200
|
c as formatTemplate,
|
|
190
|
-
|
|
191
|
-
|
|
201
|
+
fe as getFormProps,
|
|
202
|
+
sr as getPaginationRange,
|
|
192
203
|
F as ko,
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
204
|
+
Io as messages,
|
|
205
|
+
So as notifications,
|
|
206
|
+
R as uiContextDefaultValue,
|
|
207
|
+
M as useCheckDevice,
|
|
208
|
+
We as useCombobox,
|
|
209
|
+
Ue as useComboboxContext,
|
|
199
210
|
a as useCssVariableValue,
|
|
200
211
|
n as useCssVariableValues,
|
|
201
|
-
|
|
202
|
-
|
|
212
|
+
N as useDeviceType,
|
|
213
|
+
se as useFormItemWrapperDefaults,
|
|
203
214
|
x as useFormWrapperProps,
|
|
204
215
|
e as useImeSafeInput,
|
|
205
|
-
|
|
206
|
-
|
|
216
|
+
O as useLocale,
|
|
217
|
+
no as useOverlayLayer,
|
|
218
|
+
at as useRadioContext,
|
|
207
219
|
p as useStickyBox,
|
|
208
|
-
|
|
209
|
-
|
|
220
|
+
Lr as useTree,
|
|
221
|
+
dr as useTreeContext,
|
|
210
222
|
y as useUiContext,
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
223
|
+
H as useUiLink,
|
|
224
|
+
d as zhHans,
|
|
225
|
+
I as zhHant
|
|
214
226
|
};
|
|
@@ -5,6 +5,16 @@ export interface UiContextValue {
|
|
|
5
5
|
locale: UiLocale;
|
|
6
6
|
deviceType: DeviceType;
|
|
7
7
|
linkComponent: UiLinkComponent;
|
|
8
|
+
/**
|
|
9
|
+
* 浮层的默认挂载点。`null` 表示挂到 `document.body`(默认行为)。
|
|
10
|
+
*
|
|
11
|
+
* 由 `UiProvider` 的 `portalRoot` 传入,宿主可以直接给一个自己的挂载点元素。
|
|
12
|
+
* 给 Shadow DOM 场景用:传 shadow root 或它内部的容器元素,浮层就不会跑到外层
|
|
13
|
+
* document 上,从而拿到 shadow 内注入的样式与 CSS 变量。
|
|
14
|
+
*
|
|
15
|
+
* 只在 render 期读取,所以必须是「值」而不是 ref —— 组件库不负责解析它。
|
|
16
|
+
*/
|
|
17
|
+
portalRoot: ShadowRoot | HTMLElement | null;
|
|
8
18
|
/**
|
|
9
19
|
* False only in the value `createContext` falls back to, so a component can
|
|
10
20
|
* tell "no provider above me" from "a provider that chose the defaults".
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createContext as e } from "react";
|
|
3
|
-
import { en as
|
|
4
|
-
import { DefaultUiLink as
|
|
5
|
-
const
|
|
6
|
-
locale:
|
|
3
|
+
import { en as o } from "../locale/en.js";
|
|
4
|
+
import { DefaultUiLink as t } from "./ui-link.js";
|
|
5
|
+
const n = {
|
|
6
|
+
locale: o,
|
|
7
7
|
deviceType: "desktop",
|
|
8
|
-
linkComponent:
|
|
8
|
+
linkComponent: t,
|
|
9
|
+
portalRoot: null,
|
|
9
10
|
hasProvider: !1
|
|
10
|
-
}, a = e(
|
|
11
|
+
}, a = e(n);
|
|
11
12
|
export {
|
|
12
13
|
a as UiContext,
|
|
13
|
-
|
|
14
|
+
n as uiContextDefaultValue
|
|
14
15
|
};
|
|
@@ -14,6 +14,28 @@ export interface UiProviderProps {
|
|
|
14
14
|
* `'use client'` boundary — a Server Component cannot serialize it.
|
|
15
15
|
*/
|
|
16
16
|
readonly linkComponent?: UiLinkComponent;
|
|
17
|
+
/**
|
|
18
|
+
* 浮层的默认挂载点,不传则挂到 `document.body`。
|
|
19
|
+
*
|
|
20
|
+
* 组件库所有浮层(Modal、Popover、Tooltip 等)的 `Portal` 都会挂到这里,
|
|
21
|
+
* 宿主可以直接传入自己的挂载点元素。
|
|
22
|
+
*
|
|
23
|
+
* **给 Shadow DOM 场景用。** 默认挂到 `document.body` 会落在 shadow root 之外 ——
|
|
24
|
+
* 那里拿不到 shadow 内注入的样式与 CSS 变量,浮层会完全没有样式。
|
|
25
|
+
* 把 shadow root,或 shadow root 内部的一个容器元素传进来,浮层就留在 shadow 里。
|
|
26
|
+
*
|
|
27
|
+
* 传 `ShadowRoot` 本身时,浮层会成为它的直接子节点,所以样式与 CSS 变量必须定义在
|
|
28
|
+
* shadow root 层级(`adoptedStyleSheets` 或 shadow root 下的 `<style>`);
|
|
29
|
+
* 变量定义在内层包裹元素上时,改传那个包裹元素。
|
|
30
|
+
*
|
|
31
|
+
* 必须是「值」而不是 ref:浮层在 render 期就要知道挂到哪里,读 ref 属于不纯操作,
|
|
32
|
+
* 而且 ref 首帧一定是空的,会把浮层的挂载拆成两段渲染。宿主本来就是
|
|
33
|
+
* `attachShadow()` 的调用者,直接传它的返回值即可。
|
|
34
|
+
*
|
|
35
|
+
* 这个值不要在浮层打开之后再变 —— 挂载点变了 React 会卸载重建整棵浮层子树,
|
|
36
|
+
* 子组件状态会丢、入场动画会重放。
|
|
37
|
+
*/
|
|
38
|
+
readonly portalRoot?: ShadowRoot | HTMLElement | null;
|
|
17
39
|
readonly children: ReactNode;
|
|
18
40
|
}
|
|
19
|
-
export declare const UiProvider: ({ locale, deviceType, linkComponent, children, }: UiProviderProps) => import("react").JSX.Element;
|
|
41
|
+
export declare const UiProvider: ({ locale, deviceType, linkComponent, portalRoot, children, }: UiProviderProps) => import("react").JSX.Element;
|
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useMemo as
|
|
2
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo as u } from "react";
|
|
4
4
|
import { en as f } from "../locale/en.js";
|
|
5
|
-
import { UiContext as
|
|
5
|
+
import { UiContext as n } from "./ui-context.js";
|
|
6
6
|
import { DefaultUiLink as p } from "./ui-link.js";
|
|
7
|
-
const
|
|
7
|
+
const a = ({
|
|
8
8
|
locale: r = f,
|
|
9
9
|
deviceType: o = "desktop",
|
|
10
10
|
linkComponent: t = p,
|
|
11
|
-
|
|
11
|
+
portalRoot: i = null,
|
|
12
|
+
children: e
|
|
12
13
|
}) => {
|
|
13
|
-
const
|
|
14
|
-
() => ({
|
|
15
|
-
|
|
14
|
+
const m = u(
|
|
15
|
+
() => ({
|
|
16
|
+
locale: r,
|
|
17
|
+
deviceType: o,
|
|
18
|
+
linkComponent: t,
|
|
19
|
+
portalRoot: i,
|
|
20
|
+
hasProvider: !0
|
|
21
|
+
}),
|
|
22
|
+
[r, o, t, i]
|
|
16
23
|
);
|
|
17
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ s(n.Provider, { value: m, children: e });
|
|
18
25
|
};
|
|
19
26
|
export {
|
|
20
|
-
|
|
27
|
+
a as UiProvider
|
|
21
28
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wisdomgarden/torque",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Torque Design — Wisdom Garden's base UI component library for React.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
"@mantine/hooks": "^8.3.6",
|
|
154
154
|
"@mantine/notifications": "^8.3.6",
|
|
155
155
|
"@tanstack/react-virtual": "^3.13.18",
|
|
156
|
-
"@wisdomgarden/torque-icons": "^0.1.
|
|
156
|
+
"@wisdomgarden/torque-icons": "^0.1.4",
|
|
157
157
|
"@wisdomgarden/torque-styles": "^0.1.2",
|
|
158
158
|
"ahooks": "^3.9.0",
|
|
159
159
|
"dayjs": "^1.11.13",
|
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
"@tanstack/react-virtual": "^3.13.18",
|
|
177
177
|
"@types/react": "^19.2.18",
|
|
178
178
|
"@types/react-dom": "^19.2.4",
|
|
179
|
-
"@wisdomgarden/torque-icons": "0.1.
|
|
179
|
+
"@wisdomgarden/torque-icons": "0.1.4",
|
|
180
180
|
"@wisdomgarden/torque-styles": "0.1.2",
|
|
181
181
|
"ahooks": "^3.9.0",
|
|
182
182
|
"dayjs": "^1.11.13",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 登记已打开的 Popover,并返回只清理本次登记的注销函数。
|
|
3
|
-
* depth 表示逻辑嵌套层级,order 用于区分同层浮层的打开先后。
|
|
4
|
-
*/
|
|
5
|
-
export declare function registerOpenPopover(id: string, depth: number): () => void;
|
|
6
|
-
/**
|
|
7
|
-
* 判断 Popover 是否位于当前逻辑栈顶:嵌套更深者优先,同一深度下后打开者优先。
|
|
8
|
-
* Escape 关闭前使用该结果,避免一次按键同时关闭多层浮层。
|
|
9
|
-
*/
|
|
10
|
-
export declare function isTopmostOpenPopover(id: string): boolean;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
const r = /* @__PURE__ */ new Map();
|
|
3
|
-
let p = 0;
|
|
4
|
-
function s(e, t) {
|
|
5
|
-
const o = {
|
|
6
|
-
depth: t,
|
|
7
|
-
order: p++
|
|
8
|
-
};
|
|
9
|
-
return r.set(e, o), () => {
|
|
10
|
-
r.get(e) === o && r.delete(e);
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
function f(e) {
|
|
14
|
-
const t = r.get(e);
|
|
15
|
-
if (!t) return !1;
|
|
16
|
-
for (const [o, n] of r)
|
|
17
|
-
if (o !== e && (n.depth > t.depth || n.depth === t.depth && n.order > t.order))
|
|
18
|
-
return !1;
|
|
19
|
-
return !0;
|
|
20
|
-
}
|
|
21
|
-
export {
|
|
22
|
-
f as isTopmostOpenPopover,
|
|
23
|
-
s as registerOpenPopover
|
|
24
|
-
};
|