blixify-ui-web-mcp 0.1.3 → 0.1.19
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/lib/components/action/button/README.md +12 -11
- package/lib/components/action/button/button.stories.tsx +38 -27
- package/lib/components/action/buttonGroup/buttonGroup.stories.tsx +82 -16
- package/lib/components/action/iconButton/README.md +1 -0
- package/lib/components/action/iconButton/iconButton.stories.tsx +6 -12
- package/lib/components/action/radioList/radioList.stories.tsx +10 -16
- package/lib/components/action/slider/slider.stories.tsx +9 -15
- package/lib/components/action/textButton/textButton.stories.tsx +6 -12
- package/lib/components/action/toggle/toggle.stories.tsx +6 -12
- package/lib/components/advanced/collapse/collapse.stories.tsx +240 -24
- package/lib/components/advanced/infoWindow/infoWindow.stories.tsx +10 -16
- package/lib/components/advanced/popUp/README.md +33 -7
- package/lib/components/advanced/popUp/popUp.stories.tsx +9 -15
- package/lib/components/auth/bareSignIn/bareSignIn.stories.tsx +36 -16
- package/lib/components/auth/bareSignUp/bareSignUp.stories.tsx +7 -13
- package/lib/components/auth/signIn/signIn.stories.tsx +4 -10
- package/lib/components/auth/signUp/signUp.stories.tsx +4 -10
- package/lib/components/chart/areaChart/areaChart.stories.tsx +12 -18
- package/lib/components/chart/barChart/barChart.stories.tsx +12 -18
- package/lib/components/chart/boxPlotChart/boxPlotChart.stories.tsx +11 -17
- package/lib/components/chart/bubbleChart/bubbleChart.stories.tsx +11 -17
- package/lib/components/chart/card/card.stories.tsx +172 -38
- package/lib/components/chart/ganttChart/ganttChart.stories.tsx +10 -16
- package/lib/components/chart/heatmapChart/heatmapChart.stories.tsx +11 -17
- package/lib/components/chart/lineChart/lineChart.stories.tsx +8 -14
- package/lib/components/chart/pieChart/pieChart.stories.tsx +11 -17
- package/lib/components/chart/polarAreaChart/polarAreaChart.stories.tsx +11 -17
- package/lib/components/chart/radarChart/radarChart.stories.tsx +6 -12
- package/lib/components/chart/radialBar/radialChart.stories.tsx +4 -10
- package/lib/components/chart/rangeBarChart/rangeBarChart.stories.tsx +8 -14
- package/lib/components/chart/statsCard/statsCard.stories.tsx +12 -18
- package/lib/components/chart/treemapChart/treemapChart.stories.tsx +11 -17
- package/lib/components/chat/chatAnchor/README.md +7 -0
- package/lib/components/chat/chatAnchor/chatAnchor.stories.tsx +15 -21
- package/lib/components/chat/chatBase/README.md +103 -22
- package/lib/components/chat/chatBase/chatBase.stories.tsx +657 -57
- package/lib/components/chat/chatDashboard/README.md +17 -15
- package/lib/components/chat/chatDashboard/chatDashboard.stories.tsx +358 -46
- package/lib/components/data/dataGraph/dataGraph.stories.tsx +8 -14
- package/lib/components/data/dataReference/dataReference.stories.tsx +9 -15
- package/lib/components/data/dataTemplate/README.md +443 -129
- package/lib/components/data/dataTemplate/dataModule.stories.tsx +10 -15
- package/lib/components/data/dataTemplate/dataTemplate.stories.tsx +20 -34
- package/lib/components/data/dataWrapper/README.md +207 -84
- package/lib/components/data/dataWrapper/dataWrapper.consumer.stories.tsx +2125 -0
- package/lib/components/data/dataWrapper/dataWrapper.edit.stories.tsx +607 -0
- package/lib/components/data/dataWrapper/dataWrapper.utils.stories.tsx +576 -0
- package/lib/components/data/dataWrapper/dataWrapper.view.stories.tsx +1273 -0
- package/lib/components/data/flexFilter/flexFilter.stories.tsx +171 -0
- package/lib/components/data/queryForm/queryForm.stories.tsx +6 -12
- package/lib/components/data/readQuery/readQuery.stories.tsx +6 -11
- package/lib/components/data/readQueryHoc/readQueryHoc.stories.tsx +6 -12
- package/lib/components/data/writeQuery/README.md +21 -10
- package/lib/components/data/writeQuery/writeQuery.stories.tsx +6 -10
- package/lib/components/design/actionSection/actionSection.stories.tsx +10 -14
- package/lib/components/design/banner/banner.stories.tsx +6 -12
- package/lib/components/design/bannerAction/bannerAction.stories.tsx +100 -21
- package/lib/components/design/blogSection/blogSection.stories.tsx +6 -12
- package/lib/components/design/carouselSection/carouselSection.stories.tsx +6 -12
- package/lib/components/design/designList/designList.stories.tsx +6 -12
- package/lib/components/design/faq/faq.stories.tsx +53 -31
- package/lib/components/design/fileGrid/fileGrid.stories.tsx +10 -16
- package/lib/components/design/fileViewer/fileViewer.stories.tsx +6 -12
- package/lib/components/design/footerSection/footerSection.stories.tsx +6 -12
- package/lib/components/design/googleReview/googleReview.stories.tsx +6 -12
- package/lib/components/design/heroSection/heroSection.stories.tsx +10 -16
- package/lib/components/design/iconList/iconList.stories.tsx +6 -12
- package/lib/components/design/imageGallery/imageGallery.stories.tsx +6 -12
- package/lib/components/design/imageZoom/imageZoom.stories.tsx +6 -12
- package/lib/components/design/leftContent/leftContent.stories.tsx +6 -12
- package/lib/components/design/logoCloud/logoCloud.stories.tsx +6 -12
- package/lib/components/design/onboarding/onboarding.stories.tsx +8 -14
- package/lib/components/design/pricing/pricing.stories.tsx +6 -12
- package/lib/components/design/rightContent/rightContent.stories.tsx +6 -12
- package/lib/components/design/sectionList/sectionList.stories.tsx +6 -12
- package/lib/components/design/teams/teams.stories.tsx +6 -12
- package/lib/components/display/alert/alert.stories.tsx +8 -14
- package/lib/components/display/calendar/README.md +49 -0
- package/lib/components/display/calendar/calendar.stories.tsx +78 -35
- package/lib/components/display/clipboard/clipboard.stories.tsx +6 -12
- package/lib/components/display/detailList/detailList.stories.tsx +172 -48
- package/lib/components/display/drawer/README.md +44 -11
- package/lib/components/display/drawer/drawer.stories.tsx +71 -16
- package/lib/components/display/emptyState/emptyState.stories.tsx +47 -15
- package/lib/components/display/feeds/feeds.stories.tsx +6 -12
- package/lib/components/display/flexTable/README.md +11 -7
- package/lib/components/display/flexTable/flexTable.stories.tsx +318 -20
- package/lib/components/display/grid/README.md +29 -30
- package/lib/components/display/grid/grid.stories.tsx +16 -23
- package/lib/components/display/kanban/kanban.stories.tsx +17 -23
- package/lib/components/display/list/README.md +30 -29
- package/lib/components/display/list/list.stories.tsx +11 -17
- package/lib/components/display/loading/loading.stories.tsx +7 -12
- package/lib/components/display/mapView/mapView.stories.tsx +9 -15
- package/lib/components/display/modal/modal.stories.tsx +6 -13
- package/lib/components/display/newCalendar/README.md +163 -0
- package/lib/components/display/newCalendar/newCalendar.stories.tsx +292 -0
- package/lib/components/display/newFeeds/README.md +53 -0
- package/lib/components/display/newFeeds/newFeeds.stories.tsx +104 -0
- package/lib/components/display/newKanban/README.md +25 -0
- package/lib/components/display/newKanban/newKanban.stories.tsx +131 -0
- package/lib/components/display/newList/README.md +30 -0
- package/lib/components/display/newList/newList.stories.tsx +231 -0
- package/lib/components/display/newPagination/README.md +15 -0
- package/lib/components/display/newTable/README.md +121 -0
- package/lib/components/display/newTable/newTable.stories.tsx +551 -0
- package/lib/components/display/notification/notification.stories.tsx +6 -12
- package/lib/components/display/progress/progress.stories.tsx +7 -12
- package/lib/components/display/stepper/README.md +4 -0
- package/lib/components/display/stepper/stepper.stories.tsx +70 -23
- package/lib/components/display/table/README.md +38 -37
- package/lib/components/display/table/table.stories.tsx +34 -36
- package/lib/components/display/tag/tag.stories.tsx +34 -40
- package/lib/components/input/address/address.stories.tsx +12 -18
- package/lib/components/input/canvas/canvas.stories.tsx +12 -18
- package/lib/components/input/checkbox/checkbox.stories.tsx +7 -13
- package/lib/components/input/datePicker/datePicker.stories.tsx +41 -11
- package/lib/components/input/form/form.stories.tsx +11 -17
- package/lib/components/input/markdown/README.md +80 -2
- package/lib/components/input/markdown/markdown.stories.tsx +83 -32
- package/lib/components/input/monthYearPicker/monthYearPicker.stories.tsx +52 -24
- package/lib/components/input/netPromoterScore/netPromoterScore.stories.tsx +6 -12
- package/lib/components/input/rating/rating.stories.tsx +6 -12
- package/lib/components/input/select/README.md +31 -29
- package/lib/components/input/select/select.stories.tsx +33 -39
- package/lib/components/input/signature/signature.stories.tsx +12 -18
- package/lib/components/input/textArea/textArea.stories.tsx +6 -12
- package/lib/components/input/textInput/textinput.stories.tsx +14 -20
- package/lib/components/input/uploadInput/uploadInput.stories.tsx +143 -19
- package/lib/components/navigation/bars/README.md +27 -0
- package/lib/components/navigation/bars/bars.stories.tsx +56 -19
- package/lib/components/navigation/bottomTab/bottomTab.stories.tsx +7 -12
- package/lib/components/navigation/breadcrumb/breadcrumb.stories.tsx +8 -14
- package/lib/components/navigation/header/header.stories.tsx +33 -21
- package/lib/components/navigation/leftNav/leftNav.stories.tsx +10 -16
- package/lib/components/navigation/tabs/tabs.stories.tsx +10 -16
- package/lib/components/structure/column/column.stories.tsx +10 -15
- package/lib/components/structure/container/container.stories.tsx +8 -13
- package/lib/components/structure/link/link.stories.tsx +11 -17
- package/lib/components/structure/text/text.stories.tsx +12 -17
- package/lib/components/template/authPage/authPage.stories.tsx +6 -5
- package/lib/components/template/calendarView/calendarView.stories.tsx +726 -0
- package/lib/components/template/chatDashboard/chatDashboard.stories.tsx +497 -0
- package/lib/components/template/landingPage/landingPage.stories.tsx +10 -7
- package/lib/components/template/mapLayout/mapLayout.stories.tsx +519 -0
- package/lib/components/template/productListing/productListing.stories.tsx +7 -13
- package/lib/components/template/productOverview/productOverview.stories.tsx +5 -11
- package/lib/components/template/shoppingCart/shoppingCart.stories.tsx +6 -12
- package/lib/components/template/userHomePage/userHomePage.stories.tsx +384 -524
- package/lib/components/template/userRankingDashboard/userRankingDashboard.stories.tsx +145 -75
- package/lib/mcp/tools/componentsRoot.d.ts +2 -0
- package/lib/mcp/tools/componentsRoot.d.ts.map +1 -0
- package/lib/mcp/tools/componentsRoot.js +59 -0
- package/lib/mcp/tools/componentsRoot.js.map +1 -0
- package/lib/mcp/tools/getBackendComponent.d.ts.map +1 -1
- package/lib/mcp/tools/getBackendComponent.js +2 -5
- package/lib/mcp/tools/getBackendComponent.js.map +1 -1
- package/lib/mcp/tools/getComponent.d.ts.map +1 -1
- package/lib/mcp/tools/getComponent.js +2 -5
- package/lib/mcp/tools/getComponent.js.map +1 -1
- package/lib/mcp/tools/listComponents.d.ts.map +1 -1
- package/lib/mcp/tools/listComponents.js +15 -10
- package/lib/mcp/tools/listComponents.js.map +1 -1
- package/lib/mcp/tools/suggestTemplate.d.ts.map +1 -1
- package/lib/mcp/tools/suggestTemplate.js +107 -21
- package/lib/mcp/tools/suggestTemplate.js.map +1 -1
- package/package.json +1 -1
- package/lib/components/data/dataWrapper/dataWrapper.stories.tsx +0 -831
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
ArrowsPointingOutIcon,
|
|
3
|
+
MapIcon,
|
|
4
|
+
SparklesIcon,
|
|
5
|
+
} from "@heroicons/react/24/solid";
|
|
3
6
|
import React, { useState } from "react";
|
|
4
|
-
import { Collapse } from ".";
|
|
7
|
+
import { Collapse as CollapseImpl } from ".";
|
|
5
8
|
import { Stepper } from "../../display/stepper";
|
|
6
|
-
import README from "./README.md";
|
|
7
9
|
import { StorySection } from "../../storyUtils";
|
|
8
10
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
stories.addParameters({
|
|
12
|
-
readme: {
|
|
13
|
-
content: README,
|
|
14
|
-
},
|
|
15
|
-
});
|
|
11
|
+
const meta = { title: "Advanced/Collapse" };
|
|
12
|
+
export default meta;
|
|
16
13
|
|
|
17
14
|
const loremContent = (
|
|
18
15
|
<div className="w-full p-3 text-sm text-gray-700">
|
|
@@ -38,12 +35,12 @@ const stepperComp = (
|
|
|
38
35
|
</div>
|
|
39
36
|
);
|
|
40
37
|
|
|
41
|
-
|
|
38
|
+
export const Collapse = () => {
|
|
42
39
|
const [collapse, setCollapse] = useState(true);
|
|
43
40
|
const toggle = () => setCollapse((prev) => !prev);
|
|
44
41
|
|
|
45
42
|
return (
|
|
46
|
-
<div className="font-sans
|
|
43
|
+
<div className="font-sans p-6">
|
|
47
44
|
<StorySection
|
|
48
45
|
title="Default"
|
|
49
46
|
description={
|
|
@@ -56,7 +53,7 @@ stories.add("Collapse", () => {
|
|
|
56
53
|
}
|
|
57
54
|
>
|
|
58
55
|
<div className="w-full rounded-lg border overflow-hidden">
|
|
59
|
-
<
|
|
56
|
+
<CollapseImpl
|
|
60
57
|
title="Map View"
|
|
61
58
|
collapse={collapse}
|
|
62
59
|
defaultValue={false}
|
|
@@ -79,7 +76,7 @@ stories.add("Collapse", () => {
|
|
|
79
76
|
}
|
|
80
77
|
>
|
|
81
78
|
<div className="w-full rounded-lg border overflow-hidden">
|
|
82
|
-
<
|
|
79
|
+
<CollapseImpl
|
|
83
80
|
title="Map View"
|
|
84
81
|
collapse={collapse}
|
|
85
82
|
icon={<MapIcon className="w-5 h-5 text-primary-500" />}
|
|
@@ -111,15 +108,15 @@ stories.add("Collapse", () => {
|
|
|
111
108
|
}
|
|
112
109
|
>
|
|
113
110
|
<div className="w-full rounded-lg border overflow-hidden">
|
|
114
|
-
<
|
|
111
|
+
<CollapseImpl
|
|
115
112
|
title="Map View"
|
|
116
113
|
desc="Lorem ipsum dolor sit amet"
|
|
117
114
|
collapse={collapse}
|
|
118
115
|
icon={<></>}
|
|
119
116
|
collapseContainerCss="bg-primary-600"
|
|
120
117
|
notCollapseContainerCss="bg-primary-600"
|
|
121
|
-
titleClassName="text-white text-
|
|
122
|
-
descClassName="text-white"
|
|
118
|
+
titleClassName="text-white text-base font-semibold leading-tight"
|
|
119
|
+
descClassName="text-white text-xs"
|
|
123
120
|
iconClassName="w-5 h-5 text-white"
|
|
124
121
|
content={loremContent}
|
|
125
122
|
handleCollapse={toggle}
|
|
@@ -127,6 +124,114 @@ stories.add("Collapse", () => {
|
|
|
127
124
|
</div>
|
|
128
125
|
</StorySection>
|
|
129
126
|
|
|
127
|
+
<StorySection
|
|
128
|
+
title="Summary Line"
|
|
129
|
+
description={
|
|
130
|
+
<>
|
|
131
|
+
Use <code>summary</code> to show a one-line gist beside the title
|
|
132
|
+
while collapsed. Lets users scan a list of sections without
|
|
133
|
+
expanding each one.
|
|
134
|
+
</>
|
|
135
|
+
}
|
|
136
|
+
>
|
|
137
|
+
<div className="w-full rounded-lg border overflow-hidden">
|
|
138
|
+
<CollapseImpl
|
|
139
|
+
title="Order Details"
|
|
140
|
+
summary="3 items · RM 1,260"
|
|
141
|
+
icon={<MapIcon className="w-5 h-5 text-primary-500" />}
|
|
142
|
+
content={loremContent}
|
|
143
|
+
defaultOpen={false}
|
|
144
|
+
/>
|
|
145
|
+
</div>
|
|
146
|
+
</StorySection>
|
|
147
|
+
|
|
148
|
+
<StorySection
|
|
149
|
+
title="Modern Mobile — Gradient Header + Content Padding"
|
|
150
|
+
description={
|
|
151
|
+
<>
|
|
152
|
+
iOS-card feel for mobile: 3-stop gradient header (
|
|
153
|
+
<code>
|
|
154
|
+
bg-gradient-to-br from-primary-700 via-primary-500 to-primary-300
|
|
155
|
+
</code>
|
|
156
|
+
), rounded-2xl outer shadow, and the new{" "}
|
|
157
|
+
<code>contentClassName</code> prop to control padding/bg around the
|
|
158
|
+
content area. Use <code>summary</code> to keep the gist visible
|
|
159
|
+
while collapsed.
|
|
160
|
+
</>
|
|
161
|
+
}
|
|
162
|
+
>
|
|
163
|
+
<div className="w-full overflow-hidden rounded-2xl shadow-md">
|
|
164
|
+
<CollapseImpl
|
|
165
|
+
title="Order Details"
|
|
166
|
+
summary="3 items · RM 1,260"
|
|
167
|
+
collapse={collapse}
|
|
168
|
+
handleCollapse={toggle}
|
|
169
|
+
icon={<MapIcon className="w-5 h-5 text-white" />}
|
|
170
|
+
collapseContainerCss="bg-gradient-to-br from-primary-700 via-primary-500 to-primary-300 !border-0"
|
|
171
|
+
notCollapseContainerCss="bg-gradient-to-br from-primary-700 via-primary-500 to-primary-300"
|
|
172
|
+
titleClassName="text-white text-base font-semibold"
|
|
173
|
+
summaryClassName="text-primary-50"
|
|
174
|
+
descClassName="text-primary-50"
|
|
175
|
+
iconClassName="w-5 h-5 text-white"
|
|
176
|
+
contentClassName="p-5 bg-white border-t border-primary-100"
|
|
177
|
+
content={
|
|
178
|
+
<div className="space-y-2 text-sm text-gray-700">
|
|
179
|
+
<div className="flex items-center justify-between">
|
|
180
|
+
<span className="text-gray-500">Subtotal</span>
|
|
181
|
+
<span className="font-medium">RM 1,200.00</span>
|
|
182
|
+
</div>
|
|
183
|
+
<div className="flex items-center justify-between">
|
|
184
|
+
<span className="text-gray-500">Tax</span>
|
|
185
|
+
<span className="font-medium">RM 60.00</span>
|
|
186
|
+
</div>
|
|
187
|
+
<div className="flex items-center justify-between border-t border-gray-100 pt-2">
|
|
188
|
+
<span className="font-semibold text-gray-900">Total</span>
|
|
189
|
+
<span className="font-bold text-primary-600">
|
|
190
|
+
RM 1,260.00
|
|
191
|
+
</span>
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
194
|
+
}
|
|
195
|
+
/>
|
|
196
|
+
</div>
|
|
197
|
+
</StorySection>
|
|
198
|
+
|
|
199
|
+
<StorySection
|
|
200
|
+
title="Modern Mobile — Padding-only Override"
|
|
201
|
+
description={
|
|
202
|
+
<>
|
|
203
|
+
If the default gradient/header is fine but you just want tighter or
|
|
204
|
+
looser content padding, pass{" "}
|
|
205
|
+
<code>contentClassName="p-2"</code> (tighter) or{" "}
|
|
206
|
+
<code>contentClassName="p-8"</code> (looser). No need to
|
|
207
|
+
override the whole header.
|
|
208
|
+
</>
|
|
209
|
+
}
|
|
210
|
+
>
|
|
211
|
+
<div className="w-full space-y-3">
|
|
212
|
+
<div className="overflow-hidden rounded-xl border border-gray-200">
|
|
213
|
+
<CollapseImpl
|
|
214
|
+
title="Tight padding (p-2)"
|
|
215
|
+
icon={<MapIcon className="w-5 h-5 text-primary-500" />}
|
|
216
|
+
contentClassName="p-2 text-xs text-gray-600"
|
|
217
|
+
content={<div>Content with tight padding.</div>}
|
|
218
|
+
defaultOpen
|
|
219
|
+
/>
|
|
220
|
+
</div>
|
|
221
|
+
<div className="overflow-hidden rounded-xl border border-gray-200">
|
|
222
|
+
<CollapseImpl
|
|
223
|
+
title="Loose padding (p-8)"
|
|
224
|
+
icon={<MapIcon className="w-5 h-5 text-primary-500" />}
|
|
225
|
+
contentClassName="p-8 text-sm text-gray-700"
|
|
226
|
+
content={
|
|
227
|
+
<div>Content with loose padding for breathing room.</div>
|
|
228
|
+
}
|
|
229
|
+
defaultOpen
|
|
230
|
+
/>
|
|
231
|
+
</div>
|
|
232
|
+
</div>
|
|
233
|
+
</StorySection>
|
|
234
|
+
|
|
130
235
|
<StorySection
|
|
131
236
|
title="Collapse Additional Component + Expand Button"
|
|
132
237
|
description={
|
|
@@ -138,15 +243,15 @@ stories.add("Collapse", () => {
|
|
|
138
243
|
}
|
|
139
244
|
>
|
|
140
245
|
<div className="w-full rounded-lg border overflow-hidden">
|
|
141
|
-
<
|
|
246
|
+
<CollapseImpl
|
|
142
247
|
title="Map View"
|
|
143
248
|
desc="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
|
|
144
249
|
collapse={collapse}
|
|
145
250
|
icon={<></>}
|
|
146
|
-
collapseContainerCss="bg-primary-
|
|
147
|
-
notCollapseContainerCss="bg-primary-
|
|
148
|
-
titleClassName="text-white text-
|
|
149
|
-
descClassName="text-white"
|
|
251
|
+
collapseContainerCss="bg-primary-600"
|
|
252
|
+
notCollapseContainerCss="bg-primary-600"
|
|
253
|
+
titleClassName="text-white text-base font-semibold leading-tight"
|
|
254
|
+
descClassName="text-white text-xs"
|
|
150
255
|
iconClassName="w-5 h-5 text-white"
|
|
151
256
|
collapseAdditionalComp={stepperComp}
|
|
152
257
|
content={
|
|
@@ -160,6 +265,117 @@ stories.add("Collapse", () => {
|
|
|
160
265
|
/>
|
|
161
266
|
</div>
|
|
162
267
|
</StorySection>
|
|
268
|
+
|
|
269
|
+
<StorySection
|
|
270
|
+
title="Compact"
|
|
271
|
+
description={
|
|
272
|
+
<>
|
|
273
|
+
Use <code>size="compact"</code> for reduced padding and font size.
|
|
274
|
+
</>
|
|
275
|
+
}
|
|
276
|
+
>
|
|
277
|
+
<div className="w-full space-y-2">
|
|
278
|
+
{["Order Summary", "Shipping Details", "Payment Info", "Notes"].map(
|
|
279
|
+
(sectionTitle) => (
|
|
280
|
+
<div
|
|
281
|
+
key={sectionTitle}
|
|
282
|
+
className="overflow-hidden rounded-lg border border-gray-200"
|
|
283
|
+
>
|
|
284
|
+
<CollapseImpl
|
|
285
|
+
title={sectionTitle}
|
|
286
|
+
icon={<MapIcon className="w-4 h-4 text-primary-500" />}
|
|
287
|
+
size="compact"
|
|
288
|
+
content={loremContent}
|
|
289
|
+
/>
|
|
290
|
+
</div>
|
|
291
|
+
)
|
|
292
|
+
)}
|
|
293
|
+
</div>
|
|
294
|
+
</StorySection>
|
|
295
|
+
|
|
296
|
+
<StorySection
|
|
297
|
+
title="AI Overview — Animated Gradient Glow"
|
|
298
|
+
description={
|
|
299
|
+
<>
|
|
300
|
+
Sci-fi accent for an "AI"-themed surface. Wraps the{" "}
|
|
301
|
+
<code>Collapse</code> in a 2px padding ring whose background is a
|
|
302
|
+
two-colour gradient (primary → violet) that animates by
|
|
303
|
+
shifting <code>background-position</code> over 4s, producing a slow
|
|
304
|
+
shimmering glow. A blurred sibling layer underneath adds an outer
|
|
305
|
+
halo for depth. Pure CSS — no extra libraries.
|
|
306
|
+
</>
|
|
307
|
+
}
|
|
308
|
+
>
|
|
309
|
+
<style>{`
|
|
310
|
+
@keyframes ai-glow {
|
|
311
|
+
0% { background-position: 0% 50%; }
|
|
312
|
+
100% { background-position: 400% 50%; }
|
|
313
|
+
}
|
|
314
|
+
@keyframes ai-pulse {
|
|
315
|
+
0%, 100% { opacity: 0.55; }
|
|
316
|
+
50% { opacity: 0.85; }
|
|
317
|
+
}
|
|
318
|
+
.ai-glow-bg {
|
|
319
|
+
/* 5-stop, non-palindrome gradient so every position looks
|
|
320
|
+
distinct — symmetric gradients look stationary mid-cycle */
|
|
321
|
+
background-image: linear-gradient(
|
|
322
|
+
120deg,
|
|
323
|
+
#6366f1 0%,
|
|
324
|
+
#a855f7 25%,
|
|
325
|
+
#ec4899 50%,
|
|
326
|
+
#06b6d4 75%,
|
|
327
|
+
#6366f1 100%
|
|
328
|
+
);
|
|
329
|
+
background-size: 400% 100%;
|
|
330
|
+
background-repeat: repeat-x;
|
|
331
|
+
animation: ai-glow 6s linear infinite;
|
|
332
|
+
}
|
|
333
|
+
.ai-glow-halo {
|
|
334
|
+
filter: blur(16px);
|
|
335
|
+
animation: ai-glow 6s linear infinite, ai-pulse 4s ease-in-out infinite;
|
|
336
|
+
}
|
|
337
|
+
`}</style>
|
|
338
|
+
<div className="relative w-full">
|
|
339
|
+
{/* Halo — blurred sibling that bleeds outside the ring. Same
|
|
340
|
+
gradient as the ring so the colours stay in sync. */}
|
|
341
|
+
<div className="ai-glow-bg ai-glow-halo absolute -inset-1 rounded-2xl" />
|
|
342
|
+
{/* Gradient ring + inner white card. notCollapseContainerCss /
|
|
343
|
+
collapseContainerCss set to bg-transparent + !border-0 so
|
|
344
|
+
the inner Collapse doesn't paint a white background or a
|
|
345
|
+
divider line over the gradient ring. */}
|
|
346
|
+
<div className="ai-glow-bg relative rounded-2xl p-[2px]">
|
|
347
|
+
<div className="rounded-2xl bg-white overflow-hidden">
|
|
348
|
+
<CollapseImpl
|
|
349
|
+
title="AI Overview"
|
|
350
|
+
summary="Generated 12 seconds ago"
|
|
351
|
+
desc="Personalised insights powered by AI"
|
|
352
|
+
collapse={collapse}
|
|
353
|
+
handleCollapse={toggle}
|
|
354
|
+
icon={<SparklesIcon className="h-5 w-5 text-violet-500" />}
|
|
355
|
+
titleClassName="text-gray-900 text-base font-semibold"
|
|
356
|
+
summaryClassName="text-violet-600 text-xs"
|
|
357
|
+
descClassName="text-gray-500 text-xs"
|
|
358
|
+
collapseContainerCss="!border-0"
|
|
359
|
+
notCollapseContainerCss="!border-0"
|
|
360
|
+
contentClassName="px-4 pb-4 pt-3 border-t border-violet-100"
|
|
361
|
+
content={
|
|
362
|
+
<div className="space-y-2 text-sm text-gray-700">
|
|
363
|
+
<p>
|
|
364
|
+
Your activity is trending up. Engagement is 18% above last
|
|
365
|
+
month and your completion rate is the highest it has been
|
|
366
|
+
since April.
|
|
367
|
+
</p>
|
|
368
|
+
<p className="text-xs text-gray-500">
|
|
369
|
+
Suggested next step: review yesterday's incomplete tasks
|
|
370
|
+
before the standup at 10:00 AM.
|
|
371
|
+
</p>
|
|
372
|
+
</div>
|
|
373
|
+
}
|
|
374
|
+
/>
|
|
375
|
+
</div>
|
|
376
|
+
</div>
|
|
377
|
+
</div>
|
|
378
|
+
</StorySection>
|
|
163
379
|
</div>
|
|
164
380
|
);
|
|
165
|
-
}
|
|
381
|
+
};
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
import { BoltIcon } from "@heroicons/react/24/outline";
|
|
2
2
|
import { QuestionMarkCircleIcon } from "@heroicons/react/24/solid";
|
|
3
|
-
import { storiesOf } from "@storybook/react";
|
|
4
3
|
import React from "react";
|
|
5
|
-
import { InfoWindow } from ".";
|
|
6
|
-
import README from "./README.md";
|
|
4
|
+
import { InfoWindow as InfoWindowImpl } from ".";
|
|
7
5
|
import { StorySection } from "../../storyUtils";
|
|
8
6
|
|
|
9
|
-
const
|
|
7
|
+
const meta = { title: "Advanced/Info Window" };
|
|
8
|
+
export default meta;
|
|
10
9
|
|
|
11
|
-
stories.addParameters({
|
|
12
|
-
readme: {
|
|
13
|
-
content: README,
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
10
|
|
|
17
11
|
const infoContent = (
|
|
18
12
|
<div className="w-60 bg-gray-200 p-3 rounded-lg text-sm text-gray-700">
|
|
@@ -22,7 +16,7 @@ const infoContent = (
|
|
|
22
16
|
|
|
23
17
|
const iconClassName = "h-6 w-6 text-gray-400";
|
|
24
18
|
|
|
25
|
-
|
|
19
|
+
export const InfoWindow = () => (
|
|
26
20
|
<div className="font-sans max-w-2xl p-6">
|
|
27
21
|
<StorySection
|
|
28
22
|
title="Position: Right"
|
|
@@ -34,7 +28,7 @@ stories.add("Info Window", () => (
|
|
|
34
28
|
</>
|
|
35
29
|
}
|
|
36
30
|
>
|
|
37
|
-
<
|
|
31
|
+
<InfoWindowImpl
|
|
38
32
|
type="right"
|
|
39
33
|
defaultOpen={true}
|
|
40
34
|
content={infoContent}
|
|
@@ -51,7 +45,7 @@ stories.add("Info Window", () => (
|
|
|
51
45
|
</>
|
|
52
46
|
}
|
|
53
47
|
>
|
|
54
|
-
<
|
|
48
|
+
<InfoWindowImpl
|
|
55
49
|
type="left"
|
|
56
50
|
content={infoContent}
|
|
57
51
|
icon={<QuestionMarkCircleIcon className={iconClassName} />}
|
|
@@ -68,7 +62,7 @@ stories.add("Info Window", () => (
|
|
|
68
62
|
</>
|
|
69
63
|
}
|
|
70
64
|
>
|
|
71
|
-
<
|
|
65
|
+
<InfoWindowImpl
|
|
72
66
|
type="bottom start"
|
|
73
67
|
content={infoContent}
|
|
74
68
|
icon={<BoltIcon className={iconClassName} />}
|
|
@@ -84,7 +78,7 @@ stories.add("Info Window", () => (
|
|
|
84
78
|
</>
|
|
85
79
|
}
|
|
86
80
|
>
|
|
87
|
-
<
|
|
81
|
+
<InfoWindowImpl
|
|
88
82
|
type="top start"
|
|
89
83
|
content={infoContent}
|
|
90
84
|
icon={<BoltIcon className={iconClassName} />}
|
|
@@ -101,7 +95,7 @@ stories.add("Info Window", () => (
|
|
|
101
95
|
</>
|
|
102
96
|
}
|
|
103
97
|
>
|
|
104
|
-
<
|
|
98
|
+
<InfoWindowImpl
|
|
105
99
|
type="bottom end"
|
|
106
100
|
content={infoContent}
|
|
107
101
|
icon={<BoltIcon className={iconClassName} />}
|
|
@@ -109,4 +103,4 @@ stories.add("Info Window", () => (
|
|
|
109
103
|
/>
|
|
110
104
|
</StorySection>
|
|
111
105
|
</div>
|
|
112
|
-
)
|
|
106
|
+
)
|
|
@@ -29,6 +29,8 @@ import { Transition } from "@headlessui/react";
|
|
|
29
29
|
Close the popup from inside `renderComp` using a ref:
|
|
30
30
|
|
|
31
31
|
```jsx
|
|
32
|
+
import { Transition } from "@headlessui/react";
|
|
33
|
+
|
|
32
34
|
const ref = useRef(null);
|
|
33
35
|
|
|
34
36
|
<PopUp
|
|
@@ -68,6 +70,17 @@ Top direction with left anchor:
|
|
|
68
70
|
/>
|
|
69
71
|
```
|
|
70
72
|
|
|
73
|
+
Exclude portal elements from outside-click detection:
|
|
74
|
+
|
|
75
|
+
```jsx
|
|
76
|
+
<PopUp
|
|
77
|
+
ctaComp={<ChevronDownIcon className="h-5 w-5" />}
|
|
78
|
+
renderComp={<DatePicker />}
|
|
79
|
+
excludePortalIds={["datepicker-portal"]}
|
|
80
|
+
lib={{ Transition }}
|
|
81
|
+
/>
|
|
82
|
+
```
|
|
83
|
+
|
|
71
84
|
##### Required props
|
|
72
85
|
|
|
73
86
|
| Name | Type | Description |
|
|
@@ -78,13 +91,14 @@ Top direction with left anchor:
|
|
|
78
91
|
|
|
79
92
|
##### Optional props
|
|
80
93
|
|
|
81
|
-
| Name
|
|
82
|
-
|
|
|
83
|
-
| `trigger`
|
|
84
|
-
| `direction`
|
|
85
|
-
| `anchor`
|
|
86
|
-
| `className`
|
|
87
|
-
| `onClose`
|
|
94
|
+
| Name | Type | Default | Description |
|
|
95
|
+
| ------------------ | -------------------- | ---------- | ------------------------------------------------------------------------------------------- |
|
|
96
|
+
| `trigger` | `"click" \| "hover"` | `"click"` | How the panel is opened. `"hover"` opens on mouse enter, closes on leave |
|
|
97
|
+
| `direction` | `"top" \| "bottom"` | `"bottom"` | Whether the panel opens above or below the trigger |
|
|
98
|
+
| `anchor` | `"left" \| "right"` | `"right"` | Horizontal alignment of the panel relative to the trigger |
|
|
99
|
+
| `className` | `string` | `""` | Tailwind classes applied to the outer wrapper `div` |
|
|
100
|
+
| `onClose` | `() => void` | — | Called when the panel closes (click outside, hover leave, or via ref) |
|
|
101
|
+
| `excludePortalIds` | `string[]` | `[]` | DOM element IDs that render outside the wrapper — clicks inside these won't close the panel |
|
|
88
102
|
|
|
89
103
|
##### Ref API
|
|
90
104
|
|
|
@@ -93,3 +107,15 @@ When a `ref` is attached, the following method is available:
|
|
|
93
107
|
| Method | Description |
|
|
94
108
|
| --------------- | ----------------------------------------------------------------- |
|
|
95
109
|
| `handleOnClose` | Programmatically closes the panel and fires `onClose` if provided |
|
|
110
|
+
|
|
111
|
+
##### Escaping a clipping container
|
|
112
|
+
|
|
113
|
+
`portal` renders the panel into `document.body`, positioned against the trigger,
|
|
114
|
+
for a popup that sits inside a scrolling or clipping ancestor — an absolutely
|
|
115
|
+
positioned panel is cut off by one. The outside-click check follows the panel
|
|
116
|
+
there, so clicking inside it does not close it, and the enter/leave transition is
|
|
117
|
+
skipped since a portal cannot hold the ref `Transition` needs.
|
|
118
|
+
|
|
119
|
+
```tsx
|
|
120
|
+
<PopUp portal anchor="right" excludePortalIds={["select-portal"]} … />
|
|
121
|
+
```
|
|
@@ -5,25 +5,19 @@ import {
|
|
|
5
5
|
ShoppingCartIcon,
|
|
6
6
|
UserGroupIcon,
|
|
7
7
|
} from "@heroicons/react/24/solid";
|
|
8
|
-
import { storiesOf } from "@storybook/react";
|
|
9
8
|
import React, { useRef } from "react";
|
|
10
|
-
import { PopUp } from ".";
|
|
9
|
+
import { PopUp as PopUpImpl } from ".";
|
|
11
10
|
import { TextButton } from "../../action/textButton";
|
|
12
11
|
import { Card } from "../../chart/card";
|
|
13
|
-
import README from "./README.md";
|
|
14
12
|
import { StorySection } from "../../storyUtils";
|
|
15
13
|
|
|
16
|
-
const
|
|
14
|
+
const meta = { title: "Advanced/PopUp" };
|
|
15
|
+
export default meta;
|
|
17
16
|
|
|
18
|
-
stories.addParameters({
|
|
19
|
-
readme: {
|
|
20
|
-
content: README,
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
17
|
|
|
24
18
|
const lib = { Transition };
|
|
25
19
|
|
|
26
|
-
|
|
20
|
+
export const PopUp = () => {
|
|
27
21
|
const ref = useRef<any>(null);
|
|
28
22
|
|
|
29
23
|
const richContent = (
|
|
@@ -76,7 +70,7 @@ stories.add("PopUp", () => {
|
|
|
76
70
|
<div className="p-4 rounded-lg bg-primary-700 text-white w-72">
|
|
77
71
|
<div className="flex justify-between items-center">
|
|
78
72
|
<h5 className="font-semibold text-sm">Click to open</h5>
|
|
79
|
-
<
|
|
73
|
+
<PopUpImpl
|
|
80
74
|
ref={ref}
|
|
81
75
|
ctaComp={
|
|
82
76
|
<ChevronDownIcon className="h-5 w-5 text-white cursor-pointer" />
|
|
@@ -103,7 +97,7 @@ stories.add("PopUp", () => {
|
|
|
103
97
|
<div className="p-4 rounded-lg bg-primary-700 text-white w-72">
|
|
104
98
|
<div className="flex justify-between items-center">
|
|
105
99
|
<h5 className="font-semibold text-sm">Opens above</h5>
|
|
106
|
-
<
|
|
100
|
+
<PopUpImpl
|
|
107
101
|
ref={ref}
|
|
108
102
|
ctaComp={
|
|
109
103
|
<ChevronUpIcon className="h-5 w-5 text-white cursor-pointer" />
|
|
@@ -130,7 +124,7 @@ stories.add("PopUp", () => {
|
|
|
130
124
|
</>
|
|
131
125
|
}
|
|
132
126
|
>
|
|
133
|
-
<
|
|
127
|
+
<PopUpImpl
|
|
134
128
|
ref={ref}
|
|
135
129
|
ctaComp={
|
|
136
130
|
<Card
|
|
@@ -157,7 +151,7 @@ stories.add("PopUp", () => {
|
|
|
157
151
|
</>
|
|
158
152
|
}
|
|
159
153
|
>
|
|
160
|
-
<
|
|
154
|
+
<PopUpImpl
|
|
161
155
|
ref={ref}
|
|
162
156
|
ctaComp={
|
|
163
157
|
<Card
|
|
@@ -186,4 +180,4 @@ stories.add("PopUp", () => {
|
|
|
186
180
|
</StorySection>
|
|
187
181
|
</div>
|
|
188
182
|
);
|
|
189
|
-
}
|
|
183
|
+
}
|
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
import { storiesOf } from "@storybook/react";
|
|
2
1
|
import React, { useState } from "react";
|
|
3
|
-
import { AvailableProvider, BareSignIn } from ".";
|
|
4
|
-
import README from "./README.md";
|
|
2
|
+
import { AvailableProvider, BareSignIn as BareSignInImpl } from ".";
|
|
5
3
|
import { StorySection } from "../../storyUtils";
|
|
6
4
|
|
|
7
|
-
const
|
|
5
|
+
const meta = { title: "Auth/Bare Sign In" };
|
|
6
|
+
export default meta;
|
|
8
7
|
|
|
9
|
-
stories.addParameters({
|
|
10
|
-
readme: {
|
|
11
|
-
content: README,
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
8
|
|
|
15
9
|
const cardCls =
|
|
16
10
|
"w-full max-w-md bg-white rounded-lg shadow-sm border border-gray-100";
|
|
17
11
|
|
|
18
|
-
|
|
12
|
+
export const BareSignIn = () => {
|
|
19
13
|
const [provider, setProvider] = useState<typeof AvailableProvider>("email");
|
|
20
14
|
|
|
21
15
|
return (
|
|
@@ -32,7 +26,7 @@ stories.add("Bare Sign In", () => {
|
|
|
32
26
|
}
|
|
33
27
|
>
|
|
34
28
|
<div className={cardCls}>
|
|
35
|
-
<
|
|
29
|
+
<BareSignInImpl
|
|
36
30
|
version="0.0.1"
|
|
37
31
|
type="email"
|
|
38
32
|
provider={["email", "phone", "google", "username"]}
|
|
@@ -55,7 +49,7 @@ stories.add("Bare Sign In", () => {
|
|
|
55
49
|
}
|
|
56
50
|
>
|
|
57
51
|
<div className={cardCls}>
|
|
58
|
-
<
|
|
52
|
+
<BareSignInImpl
|
|
59
53
|
version="0.0.1"
|
|
60
54
|
type="phone"
|
|
61
55
|
mobilePicker={true}
|
|
@@ -79,7 +73,7 @@ stories.add("Bare Sign In", () => {
|
|
|
79
73
|
}
|
|
80
74
|
>
|
|
81
75
|
<div className={cardCls}>
|
|
82
|
-
<
|
|
76
|
+
<BareSignInImpl
|
|
83
77
|
version="0.0.1"
|
|
84
78
|
type="username"
|
|
85
79
|
provider={["username", "email"]}
|
|
@@ -101,7 +95,7 @@ stories.add("Bare Sign In", () => {
|
|
|
101
95
|
}
|
|
102
96
|
>
|
|
103
97
|
<div className={cardCls}>
|
|
104
|
-
<
|
|
98
|
+
<BareSignInImpl
|
|
105
99
|
version="0.0.1"
|
|
106
100
|
type="phoneOTP"
|
|
107
101
|
provider={["phoneOTP"]}
|
|
@@ -113,6 +107,32 @@ stories.add("Bare Sign In", () => {
|
|
|
113
107
|
</div>
|
|
114
108
|
</StorySection>
|
|
115
109
|
|
|
110
|
+
<StorySection
|
|
111
|
+
title="OTP Provider — WhatsApp Fallback"
|
|
112
|
+
description={
|
|
113
|
+
<>
|
|
114
|
+
Pass <code>otpRetryWhatsapp={true}</code> alongside{" "}
|
|
115
|
+
<code>onChangeResendOTP</code> to show a "Resend via WhatsApp" link
|
|
116
|
+
on the right side of "Resend OTP". The callback receives{" "}
|
|
117
|
+
<code>"sms"</code> or <code>"whatsapp"</code> depending on which was
|
|
118
|
+
clicked.
|
|
119
|
+
</>
|
|
120
|
+
}
|
|
121
|
+
>
|
|
122
|
+
<div className={cardCls}>
|
|
123
|
+
<BareSignInImpl
|
|
124
|
+
version="0.0.1"
|
|
125
|
+
type="phoneOTP"
|
|
126
|
+
provider={["phoneOTP"]}
|
|
127
|
+
onChangeProvider={setProvider}
|
|
128
|
+
column="flex"
|
|
129
|
+
className="py-6 px-4"
|
|
130
|
+
onChangeResendOTP={(channel) => console.log("resend via", channel)}
|
|
131
|
+
otpRetryWhatsapp={true}
|
|
132
|
+
/>
|
|
133
|
+
</div>
|
|
134
|
+
</StorySection>
|
|
135
|
+
|
|
116
136
|
<StorySection
|
|
117
137
|
title="Switchable Provider (controlled)"
|
|
118
138
|
description={
|
|
@@ -124,7 +144,7 @@ stories.add("Bare Sign In", () => {
|
|
|
124
144
|
}
|
|
125
145
|
>
|
|
126
146
|
<div className={cardCls}>
|
|
127
|
-
<
|
|
147
|
+
<BareSignInImpl
|
|
128
148
|
version="0.0.1"
|
|
129
149
|
type={provider}
|
|
130
150
|
mobilePicker={true}
|
|
@@ -138,4 +158,4 @@ stories.add("Bare Sign In", () => {
|
|
|
138
158
|
</StorySection>
|
|
139
159
|
</div>
|
|
140
160
|
);
|
|
141
|
-
}
|
|
161
|
+
}
|