@fewbox/den-web 0.1.44 → 0.2.0-preview.10
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/engine.js +2 -0
- package/engine.js.map +1 -0
- package/index-engine.d.ts +27 -0
- package/index-web.d.ts +1 -4
- package/index.css +1 -1
- package/index.js +2 -1
- package/index.js.map +1 -1
- package/package.json +10 -1
- package/scripts/generate-packages.js +12 -0
- package/server.js +71 -0
- package/src/components/Auth/GoogleGrant/index.d.ts +10 -8
- package/src/components/Auth/GoogleSignin/index.d.ts +6 -5
- package/src/components/Engine/Base/index.d.ts +10 -11
- package/src/components/Engine/index.d.ts +298 -274
- package/src/components/Layout/Breakpoint/index.d.ts +20 -17
- package/src/components/Layout/Dock/index.d.ts +25 -23
- package/src/components/Layout/Flex/index.d.ts +38 -33
- package/src/components/Layout/FlexItem/index.d.ts +8 -7
- package/src/components/Layout/Position/index.d.ts +19 -17
- package/src/components/Layout/PositionArea/index.d.ts +5 -4
- package/src/components/Layout/XBase/index.d.ts +8 -7
- package/src/components/Layout/YBase/index.d.ts +8 -7
- package/src/components/View/VAnimation/index.d.ts +122 -118
- package/src/components/View/VBackground/index.d.ts +10 -10
- package/src/components/View/VCardWindow/index.d.ts +6 -5
- package/src/components/View/VChromeExtensionValidator/index.d.ts +8 -7
- package/src/components/View/VForm/index.d.ts +5 -4
- package/src/components/View/VGoogleFont/index.d.ts +5 -4
- package/src/components/View/VHyperlink/index.d.ts +7 -6
- package/src/components/View/VImage/index.d.ts +12 -8
- package/src/components/View/VInput/VColor/index.d.ts +0 -2
- package/src/components/View/VInput/VDate/index.d.ts +0 -2
- package/src/components/View/VInput/VDatetimeLocal/index.d.ts +0 -2
- package/src/components/View/VInput/VFile/index.d.ts +5 -4
- package/src/components/View/VInput/VGroup/index.d.ts +1 -1
- package/src/components/View/VInput/VRange/index.d.ts +1 -2
- package/src/components/View/VLabel/index.d.ts +53 -47
- package/src/components/View/VPhoto/index.d.ts +12 -10
- package/src/components/View/VRoot/index.d.ts +5 -4
- package/src/components/View/VShadow/index.d.ts +5 -4
- package/src/components/View/VShape/VEllipse/index.d.ts +5 -4
- package/src/components/View/VShape/VLine/index.d.ts +5 -4
- package/src/components/View/VShape/VRectangle/index.d.ts +5 -4
- package/src/components/View/VSvg/index.d.ts +11 -7
- package/src/components/View/VText/index.d.ts +18 -16
- package/src/components/View/VTheme/index.d.ts +13 -11
- package/src/components/View/VTooltip/index.d.ts +5 -4
- package/src/components/View/VVideo/index.d.ts +1 -4
- package/src/components/View/VZone/index.d.ts +9 -8
- package/src/components/core.d.ts +10 -1
- package/src/components/web.d.ts +4 -0
- package/templates/.claude/skills/fewbox-den/SKILL.md +425 -96
- package/tsconfig.app.tsbuildinfo +1 -1
|
@@ -25,45 +25,61 @@ Den.Components.ColorType // enums are also under Components
|
|
|
25
25
|
|
|
26
26
|
### Variant Exports
|
|
27
27
|
|
|
28
|
-
- **core
|
|
29
|
-
- **web
|
|
30
|
-
- **app
|
|
28
|
+
- **core** (`Den.Components`): Layout (X/Y/S/Flex/FlexItem/Position/PositionArea/Dock/BreakpointDisplay/Responsive), View (VBoundary, VLabel, VText, VForm, VActionForm, VInput/*, VSelect, VDropdown, VSwitch, VImage, VSvg, VBackground, VAnimation, VTooltip, VLoading, VErrorBoundary, VShape/*, VHyperlink, VMask, VFrame, VTheme, VHeader/VMain/VFooter, VHR, VSection, VZone, VAudio, VVideo, VShadow), Enums, Types, utilities
|
|
29
|
+
- **web** (`Den.Components`): core + Debug, VGoogleFont, VChromeExtensionValidator, GoogleGrant, GoogleSignin, FigmaSignin, WeComSignin, parseJWT
|
|
30
|
+
- **app** (`Den.Components`): web + VDynamic, VAvatar, VBlock, VCard, VCardMedia, VCardSocial, VCardWindow, VPhoto, VStack, VTree
|
|
31
|
+
- **app** also exports: `Den.FewBox`, `Den.Language`, `Den.Network`, `Den.Store`
|
|
32
|
+
- **append** (no Components): `Den.FewBox`, `Den.Language`, `Den.Network`, `Den.Store`
|
|
31
33
|
|
|
32
34
|
## Core Concepts
|
|
33
35
|
|
|
34
|
-
### Common Props (IBaseProps)
|
|
36
|
+
### Common Props (IViewProps / IBaseProps)
|
|
35
37
|
|
|
36
|
-
All components extend `IBaseProps` which
|
|
38
|
+
All components extend `IBaseProps` (which extends `IViewProps`) providing these shared props:
|
|
37
39
|
|
|
38
40
|
| Prop | Type | Description |
|
|
39
41
|
|------|------|-------------|
|
|
40
42
|
| `className` | `string` | Additional CSS classes |
|
|
41
43
|
| `style` | `CSSProperties` | Inline styles |
|
|
42
|
-
| `fontSize` | `FontSizeType \|
|
|
44
|
+
| `fontSize` | `FontSizeType \| Property.FontSize` | Font size preset or custom CSS value |
|
|
45
|
+
| `isAutoSize` | `boolean` | Use auto-responsive font size variant |
|
|
43
46
|
| `fontWeight` | `FontWeightType` | Font weight (Thin through Black) |
|
|
44
|
-
| `frontColor` | `ColorType \|
|
|
45
|
-
| `backgroundColor` | `ColorType \|
|
|
46
|
-
| `borderColor` | `ColorType \|
|
|
47
|
+
| `frontColor` | `ColorType \| Property.Color` | Text/foreground color |
|
|
48
|
+
| `backgroundColor` | `ColorType \| Property.Color` | Background color |
|
|
49
|
+
| `borderColor` | `ColorType \| Property.Color` | Border color |
|
|
47
50
|
| `borderDirection` | `DirectionType` | Which sides get the border |
|
|
48
|
-
| `
|
|
49
|
-
| `
|
|
50
|
-
| `
|
|
51
|
-
| `
|
|
52
|
-
| `
|
|
53
|
-
| `
|
|
54
|
-
| `
|
|
55
|
-
| `
|
|
56
|
-
| `
|
|
57
|
-
| `
|
|
58
|
-
| `
|
|
59
|
-
| `
|
|
60
|
-
| `
|
|
61
|
-
| `
|
|
62
|
-
| `
|
|
51
|
+
| `borderRadius` | `BorderRadiusType \| Property.BorderRadius` | Border radius preset or custom |
|
|
52
|
+
| `borderStyle` | `BorderStyleType \| Property.BorderStyle` | Border style preset or custom |
|
|
53
|
+
| `borderWidth` | `BorderWidthType \| Property.BorderWidth` | Border width preset or custom |
|
|
54
|
+
| `padding` | `PaddingType \| Property.Padding` | CSS padding (preset or custom) |
|
|
55
|
+
| `margin` | `MarginType \| Property.Margin` | CSS margin (preset or custom) |
|
|
56
|
+
| `opacity` | `OpacityType \| Property.Opacity` | Opacity preset or custom CSS value |
|
|
57
|
+
| `display` | `DisplayType \| Property.Display` | CSS display preset or custom |
|
|
58
|
+
| `visibility` | `VisibilityType \| Property.Visibility` | CSS visibility preset or custom |
|
|
59
|
+
| `cursor` | `CursorType \| Property.Cursor` | CSS cursor preset or custom |
|
|
60
|
+
| `overflow` | `OverflowType \| Property.Overflow` | CSS overflow preset or custom |
|
|
61
|
+
| `overflowX` | `OverflowXType \| Property.OverflowX` | CSS overflow-x preset or custom |
|
|
62
|
+
| `overflowY` | `OverflowYType \| Property.OverflowY` | CSS overflow-y preset or custom |
|
|
63
|
+
| `width` | `Property.Width` | CSS width |
|
|
64
|
+
| `height` | `Property.Height` | CSS height |
|
|
65
|
+
| `minWidth` | `Property.Width` | CSS min-width |
|
|
66
|
+
| `minHeight` | `Property.Width` | CSS min-height |
|
|
67
|
+
| `maxWidth` | `Property.Width` | CSS max-width |
|
|
68
|
+
| `maxHeight` | `Property.Width` | CSS max-height |
|
|
69
|
+
| `zIndex` | `Property.ZIndex` | CSS z-index |
|
|
70
|
+
| `fontFamily` | `Property.FontFamily` | CSS font-family |
|
|
71
|
+
| `letterSpacing` | `LetterSpacingType \| Property.LetterSpacing` | Letter spacing preset or custom CSS value |
|
|
72
|
+
| `lineHeight` | `Property.LineHeight` | CSS line-height |
|
|
63
73
|
| `selfShrink` | `number` | flex-shrink for the component itself |
|
|
64
74
|
| `selfGrow` | `number` | flex-grow for the component itself |
|
|
65
75
|
| `selfBasis` | `string` | flex-basis for the component itself |
|
|
66
76
|
| `isDefaultValue` | `boolean` | Apply default transparency and color resets |
|
|
77
|
+
| `pseudoType` | `PseudoType` | Pseudo element target (All, Before, After) |
|
|
78
|
+
| `pseudoFrontColor` | `ColorType \| string` | Pseudo element foreground color |
|
|
79
|
+
| `pseudoBackgroundColor` | `ColorType \| string` | Pseudo element background color |
|
|
80
|
+
| `pseudoBorderColor` | `ColorType \| string` | Pseudo element border color |
|
|
81
|
+
| `pseudoBorderDirection` | `DirectionType` | Pseudo element border direction |
|
|
82
|
+
| `customAttributes` | `Object` | Custom HTML attributes to spread |
|
|
67
83
|
|
|
68
84
|
### Color System (ColorType)
|
|
69
85
|
|
|
@@ -87,7 +103,7 @@ ColorType.Border // border color
|
|
|
87
103
|
ColorType.Placeholder // placeholder color
|
|
88
104
|
ColorType.Transparent // transparent
|
|
89
105
|
|
|
90
|
-
// Each color has opacity variants:
|
|
106
|
+
// Each color has opacity variants (Light, Dark, Primary, Secondary, Tertiary, Info, Success, Warning, Error, Border, Placeholder):
|
|
91
107
|
ColorType.Primary75 // 75% opacity
|
|
92
108
|
ColorType.Primary50 // 50% opacity
|
|
93
109
|
ColorType.Primary25 // 25% opacity
|
|
@@ -96,10 +112,10 @@ ColorType.Primary25 // 25% opacity
|
|
|
96
112
|
### Font Size System (FontSizeType)
|
|
97
113
|
|
|
98
114
|
```tsx
|
|
115
|
+
FontSizeType.Default
|
|
116
|
+
FontSizeType.Normal
|
|
99
117
|
FontSizeType.ExtraSmall
|
|
100
118
|
FontSizeType.Small
|
|
101
|
-
FontSizeType.Normal
|
|
102
|
-
FontSizeType.Default
|
|
103
119
|
FontSizeType.Large
|
|
104
120
|
FontSizeType.ExtraLarge
|
|
105
121
|
|
|
@@ -128,6 +144,48 @@ FontWeightType.ExtraBold // 800
|
|
|
128
144
|
FontWeightType.Black // 900
|
|
129
145
|
```
|
|
130
146
|
|
|
147
|
+
### Preset Enums (class-based styling)
|
|
148
|
+
|
|
149
|
+
These enums generate CSS classes. All `Full*Type` props accept either a preset enum value (applied as className) or a custom CSS value from `csstype` `Property.*` (applied as inline style):
|
|
150
|
+
|
|
151
|
+
```tsx
|
|
152
|
+
// Border Radius
|
|
153
|
+
BorderRadiusType.Default | .Normal | .ExtraSmall | .Small | .Large | .ExtraLarge | .Max
|
|
154
|
+
|
|
155
|
+
// Border Style
|
|
156
|
+
BorderStyleType.None | .Solid | .Dashed | .Dotted | .Double | .Groove | .Ridge | .Inset | .Outset | .Hidden
|
|
157
|
+
|
|
158
|
+
// Border Width
|
|
159
|
+
BorderWidthType.Default | .Normal | .ExtraSmall | .Small | .Large | .ExtraLarge
|
|
160
|
+
|
|
161
|
+
// Padding
|
|
162
|
+
PaddingType.Default | .Normal | .ExtraSmall | .Small | .Large | .ExtraLarge
|
|
163
|
+
|
|
164
|
+
// Margin
|
|
165
|
+
MarginType.Default | .Normal | .ExtraSmall | .Small | .Large | .ExtraLarge
|
|
166
|
+
|
|
167
|
+
// Gap (for layout components)
|
|
168
|
+
GapType.Default | .Normal | .ExtraSmall | .Small | .Large | .ExtraLarge
|
|
169
|
+
|
|
170
|
+
// Letter Spacing
|
|
171
|
+
LetterSpacingType.Default
|
|
172
|
+
|
|
173
|
+
// Opacity
|
|
174
|
+
OpacityType._0 | ._10 | ._20 | ._25 | ._30 | ._40 | ._50 | ._60 | ._70 | ._75 | ._80 | ._90 | ._100
|
|
175
|
+
|
|
176
|
+
// Display
|
|
177
|
+
DisplayType.None | .Block | .Inline | .InlineBlock | .Flex | .InlineFlex | .Grid | .InlineGrid | .Table | .TableRow | .TableCell | .Contents | .FlowRoot
|
|
178
|
+
|
|
179
|
+
// Visibility
|
|
180
|
+
VisibilityType.Visible | .Hidden | .Collapse
|
|
181
|
+
|
|
182
|
+
// Cursor
|
|
183
|
+
CursorType.Auto | .Default | .None | .Pointer | .Wait | .Text | .Move | .NotAllowed | .Grab | .Grabbing | ... (30+ options)
|
|
184
|
+
|
|
185
|
+
// Overflow / OverflowX / OverflowY
|
|
186
|
+
OverflowType.Visible | .Hidden | .Scroll | .Auto | .Clip
|
|
187
|
+
```
|
|
188
|
+
|
|
131
189
|
---
|
|
132
190
|
|
|
133
191
|
## Layout Components
|
|
@@ -244,17 +302,13 @@ Wrap a child in an S-component to override the parent's cross-axis alignment for
|
|
|
244
302
|
</Den.Components.STop>
|
|
245
303
|
</Den.Components.XCenter>
|
|
246
304
|
|
|
247
|
-
//
|
|
305
|
+
// Available S-components:
|
|
248
306
|
<Den.Components.STop>...</Den.Components.STop> // align-self: flex-start
|
|
249
307
|
<Den.Components.SMiddle>...</Den.Components.SMiddle> // align-self: center
|
|
250
308
|
<Den.Components.SBottom>...</Den.Components.SBottom> // align-self: flex-end
|
|
251
|
-
<Den.Components.
|
|
252
|
-
<Den.Components.
|
|
253
|
-
|
|
254
|
-
// In Y containers (cross-axis is horizontal):
|
|
255
|
-
<Den.Components.SLeft>...</Den.Components.SLeft> // align-self: flex-start
|
|
256
|
-
<Den.Components.SCenter>...</Den.Components.SCenter> // align-self: center
|
|
257
|
-
<Den.Components.SRight>...</Den.Components.SRight> // align-self: flex-end
|
|
309
|
+
<Den.Components.SLeft>...</Den.Components.SLeft> // align-self: flex-start (in Y container)
|
|
310
|
+
<Den.Components.SCenter>...</Den.Components.SCenter> // align-self: center (in Y container)
|
|
311
|
+
<Den.Components.SRight>...</Den.Components.SRight> // align-self: flex-end (in Y container)
|
|
258
312
|
<Den.Components.SStretch>...</Den.Components.SStretch> // align-self: stretch
|
|
259
313
|
<Den.Components.SBaseline>...</Den.Components.SBaseline>// align-self: baseline
|
|
260
314
|
```
|
|
@@ -263,7 +317,6 @@ Wrap a child in an S-component to override the parent's cross-axis alignment for
|
|
|
263
317
|
|
|
264
318
|
```tsx
|
|
265
319
|
// PositionArea establishes a positioning context (position: relative) on its child.
|
|
266
|
-
// PositionCategory.Area = position: absolute (for items inside)
|
|
267
320
|
<Den.Components.PositionArea category={Den.Components.PositionAreaCategory.FullSize}>
|
|
268
321
|
<Den.Components.VBoundary height="250px" backgroundColor={Den.Components.ColorType.Dark}>
|
|
269
322
|
<Den.Components.Position category={Den.Components.PositionCategory.Area} type={Den.Components.PositionType.Center}>
|
|
@@ -331,60 +384,59 @@ Wrap a child in an S-component to override the parent's cross-axis alignment for
|
|
|
331
384
|
</Den.Components.Dock>
|
|
332
385
|
```
|
|
333
386
|
|
|
334
|
-
###
|
|
387
|
+
### BreakpointDisplay (Responsive Show/Hide)
|
|
335
388
|
|
|
336
|
-
**Important:**
|
|
389
|
+
**Important:** BreakpointDisplay uses `cloneElement` to inject className — child must accept `className` prop.
|
|
337
390
|
|
|
338
391
|
```tsx
|
|
339
|
-
//
|
|
340
|
-
//
|
|
392
|
+
// BreakpointCategory: Visible, Hidden
|
|
393
|
+
// BreakpointType: Only, Up, Down
|
|
394
|
+
// ScreenSizeType: ExtraSmall, Small, Medium, Large, ExtraLarge, ExtraExtraLarge
|
|
341
395
|
|
|
342
396
|
// Always visible
|
|
343
|
-
<Den.Components.
|
|
397
|
+
<Den.Components.BreakpointDisplay category={Den.Components.BreakpointCategory.Visible}>
|
|
344
398
|
<div>Always shown</div>
|
|
345
|
-
</Den.Components.
|
|
399
|
+
</Den.Components.BreakpointDisplay>
|
|
346
400
|
|
|
347
401
|
// Always hidden
|
|
348
|
-
<Den.Components.
|
|
402
|
+
<Den.Components.BreakpointDisplay category={Den.Components.BreakpointCategory.Hidden}>
|
|
349
403
|
<div>Always hidden</div>
|
|
350
|
-
</Den.Components.
|
|
404
|
+
</Den.Components.BreakpointDisplay>
|
|
351
405
|
|
|
352
406
|
// Responsive: visible only on Medium breakpoint
|
|
353
|
-
<Den.Components.
|
|
354
|
-
category={Den.Components.
|
|
355
|
-
type={Den.Components.
|
|
356
|
-
breakpoint={Den.Components.
|
|
407
|
+
<Den.Components.BreakpointDisplay
|
|
408
|
+
category={Den.Components.BreakpointCategory.Visible}
|
|
409
|
+
type={Den.Components.BreakpointType.Only}
|
|
410
|
+
breakpoint={Den.Components.ScreenSizeType.Medium}
|
|
357
411
|
>
|
|
358
412
|
<div>Medium only</div>
|
|
359
|
-
</Den.Components.
|
|
413
|
+
</Den.Components.BreakpointDisplay>
|
|
360
414
|
|
|
361
415
|
// Hidden on Small and below
|
|
362
|
-
<Den.Components.
|
|
363
|
-
category={Den.Components.
|
|
364
|
-
type={Den.Components.
|
|
365
|
-
breakpoint={Den.Components.
|
|
416
|
+
<Den.Components.BreakpointDisplay
|
|
417
|
+
category={Den.Components.BreakpointCategory.Hidden}
|
|
418
|
+
type={Den.Components.BreakpointType.Down}
|
|
419
|
+
breakpoint={Den.Components.ScreenSizeType.Small}
|
|
366
420
|
>
|
|
367
421
|
<div>Hidden on mobile</div>
|
|
368
|
-
</Den.Components.
|
|
422
|
+
</Den.Components.BreakpointDisplay>
|
|
369
423
|
|
|
370
424
|
// Multiple breakpoints (array):
|
|
371
|
-
<Den.Components.
|
|
372
|
-
category={Den.Components.
|
|
373
|
-
breakpoint={[Den.Components.
|
|
425
|
+
<Den.Components.BreakpointDisplay
|
|
426
|
+
category={Den.Components.BreakpointCategory.Visible}
|
|
427
|
+
breakpoint={[Den.Components.ScreenSizeType.Small, Den.Components.ScreenSizeType.Large]}
|
|
374
428
|
>
|
|
375
429
|
<div>Visible on Small and Large</div>
|
|
376
|
-
</Den.Components.
|
|
377
|
-
|
|
378
|
-
// BreakpointType: ExtraSmall, Small, Medium, Large, ExtraLarge, ExtraExtraLarge
|
|
430
|
+
</Den.Components.BreakpointDisplay>
|
|
379
431
|
```
|
|
380
432
|
|
|
381
433
|
### Responsive (Desktop/Mobile Switch)
|
|
382
434
|
|
|
383
435
|
```tsx
|
|
384
436
|
// Shorthand for showing desktop or mobile content based on breakpoint.
|
|
385
|
-
// Children must accept className prop (uses
|
|
437
|
+
// Children must accept className prop (uses BreakpointDisplay internally).
|
|
386
438
|
<Den.Components.Responsive
|
|
387
|
-
breakpointType={Den.Components.
|
|
439
|
+
breakpointType={Den.Components.ScreenSizeType.Medium}
|
|
388
440
|
desktop={<div>Desktop layout</div>}
|
|
389
441
|
mobile={<div>Mobile layout</div>}
|
|
390
442
|
/>
|
|
@@ -402,11 +454,11 @@ Wrap a child in an S-component to override the parent's cross-axis alignment for
|
|
|
402
454
|
|
|
403
455
|
// ZoneCategory:
|
|
404
456
|
// Fluid — always 100%, no max-width
|
|
405
|
-
// Small — constrained from
|
|
406
|
-
// Medium — constrained from
|
|
407
|
-
// Large — constrained from
|
|
408
|
-
// ExtraLarge — constrained from
|
|
409
|
-
// ExtraExtraLarge — constrained from
|
|
457
|
+
// Small — constrained from >=576px (540->720->960->1140->1320)
|
|
458
|
+
// Medium — constrained from >=768px (720->960->1140->1320)
|
|
459
|
+
// Large — constrained from >=992px (960->1140->1320)
|
|
460
|
+
// ExtraLarge — constrained from >=1200px (1140->1320)
|
|
461
|
+
// ExtraExtraLarge — constrained from >=1400px (1320)
|
|
410
462
|
```
|
|
411
463
|
|
|
412
464
|
### Flex & FlexItem (Low-level Control)
|
|
@@ -427,6 +479,9 @@ Wrap a child in an S-component to override the parent's cross-axis alignment for
|
|
|
427
479
|
<Den.Components.FlexItem grow={1} shrink={0} basis="200px" order={2}>
|
|
428
480
|
<Content />
|
|
429
481
|
</Den.Components.FlexItem>
|
|
482
|
+
|
|
483
|
+
// FlexItem also exports FlexItemAlignSelfType
|
|
484
|
+
// Flex also exports FlexAlignContentType
|
|
430
485
|
```
|
|
431
486
|
|
|
432
487
|
---
|
|
@@ -497,6 +552,18 @@ For inline text. Renders as `<span>` by default, configurable to any inline/head
|
|
|
497
552
|
// Available categories:
|
|
498
553
|
// LabelCategory.Div, Span, H1-H6, Abbr, Strong, Em, Code, Pre,
|
|
499
554
|
// Blockquote, Mark, Del, Ins, Small, Sub, Sup, etc.
|
|
555
|
+
|
|
556
|
+
// fontWeight/fontSize with heading categories (H1-H6):
|
|
557
|
+
// When fontWeight or fontSize is set, VLabel adds CSS classes
|
|
558
|
+
// (.v-label-inherit-font-weight / .v-label-inherit-font-size)
|
|
559
|
+
// that apply `inherit` to the inner heading element, overriding
|
|
560
|
+
// browser defaults. Without these props, headings keep their
|
|
561
|
+
// browser default styles (e.g., H1 is bold and 2em).
|
|
562
|
+
<Den.Components.VLabel
|
|
563
|
+
category={Den.Components.LabelCategory.H1}
|
|
564
|
+
fontWeight={Den.Components.FontWeightType.Thin}
|
|
565
|
+
caption="Thin H1"
|
|
566
|
+
/>
|
|
500
567
|
```
|
|
501
568
|
|
|
502
569
|
### VText (Block Text)
|
|
@@ -548,9 +615,10 @@ For block-level text (p, article, section, etc.):
|
|
|
548
615
|
// e.g., { form: { username: "value", password: "value" } }
|
|
549
616
|
console.log(data);
|
|
550
617
|
}}
|
|
551
|
-
handleValidateError={(
|
|
618
|
+
handleValidateError={(invalidInputs) => {
|
|
552
619
|
// Called when HTML5 validation fails
|
|
553
|
-
|
|
620
|
+
// invalidInputs is HTMLInputElement[]
|
|
621
|
+
invalidInputs[0]?.focus();
|
|
554
622
|
}}
|
|
555
623
|
>
|
|
556
624
|
<Den.Components.Y gap="0.5em">
|
|
@@ -559,6 +627,26 @@ For block-level text (p, article, section, etc.):
|
|
|
559
627
|
<Den.Components.VSubmit caption="Submit" />
|
|
560
628
|
</Den.Components.Y>
|
|
561
629
|
</Den.Components.VForm>
|
|
630
|
+
|
|
631
|
+
// HandleSubmitCategory: Json (default), FormData
|
|
632
|
+
// Use FormData category to receive raw FormData instead of parsed JSON:
|
|
633
|
+
<Den.Components.VForm
|
|
634
|
+
handleSubmitCategory={Den.Components.HandleSubmitCategory.FormData}
|
|
635
|
+
handleSubmit={(formData) => { /* formData is FormData */ }}
|
|
636
|
+
>
|
|
637
|
+
...
|
|
638
|
+
</Den.Components.VForm>
|
|
639
|
+
```
|
|
640
|
+
|
|
641
|
+
#### VActionForm (Simple Form)
|
|
642
|
+
|
|
643
|
+
A simple `<form>` wrapper without JSON conversion or validation handling:
|
|
644
|
+
|
|
645
|
+
```tsx
|
|
646
|
+
<Den.Components.VActionForm action="/api/submit" method="POST">
|
|
647
|
+
<input name="field" />
|
|
648
|
+
<button type="submit">Submit</button>
|
|
649
|
+
</Den.Components.VActionForm>
|
|
562
650
|
```
|
|
563
651
|
|
|
564
652
|
**Form data naming conventions:**
|
|
@@ -604,6 +692,8 @@ const [value, setValue] = useState('');
|
|
|
604
692
|
<Den.Components.VDate name="form.date" />
|
|
605
693
|
<Den.Components.VDatetimeLocal name="form.datetime" />
|
|
606
694
|
<Den.Components.VTime name="form.time" />
|
|
695
|
+
<Den.Components.VMonth name="form.month" />
|
|
696
|
+
<Den.Components.VWeek name="form.week" />
|
|
607
697
|
<Den.Components.VColor name="form.color" />
|
|
608
698
|
<Den.Components.VTel name="form.phone" />
|
|
609
699
|
<Den.Components.VUrl name="form.website" />
|
|
@@ -626,6 +716,19 @@ const [value, setValue] = useState('');
|
|
|
626
716
|
<Den.Components.VRadio id="opt1" name="form.option" value="A" label="Option A" />
|
|
627
717
|
<Den.Components.VRadio id="opt2" name="form.option" value="B" label="Option B" />
|
|
628
718
|
|
|
719
|
+
// Radio Group (managed state)
|
|
720
|
+
<Den.Components.VGroup
|
|
721
|
+
selectedValue="A"
|
|
722
|
+
renderGroup={(selectedValue, handleSelect) => (
|
|
723
|
+
<>
|
|
724
|
+
<Den.Components.VRadio id="opt1" name="form.option" value="A" label="A"
|
|
725
|
+
isChecked={selectedValue === 'A'} onChange={handleSelect} />
|
|
726
|
+
<Den.Components.VRadio id="opt2" name="form.option" value="B" label="B"
|
|
727
|
+
isChecked={selectedValue === 'B'} onChange={handleSelect} />
|
|
728
|
+
</>
|
|
729
|
+
)}
|
|
730
|
+
/>
|
|
731
|
+
|
|
629
732
|
// Hidden field
|
|
630
733
|
<Den.Components.VHidden name="form.id" value="123" />
|
|
631
734
|
|
|
@@ -638,6 +741,7 @@ const [value, setValue] = useState('');
|
|
|
638
741
|
]}
|
|
639
742
|
value="us"
|
|
640
743
|
/>
|
|
744
|
+
// ISelectItemData: { caption: string; value: string }
|
|
641
745
|
|
|
642
746
|
// Dropdown (custom dropdown with icons)
|
|
643
747
|
<Den.Components.VDropdown
|
|
@@ -652,6 +756,7 @@ const [value, setValue] = useState('');
|
|
|
652
756
|
enableClear
|
|
653
757
|
handleChange={(value) => console.log(value)}
|
|
654
758
|
/>
|
|
759
|
+
// IDropdownItemData: { caption: string; value: string; icon?: JSX.Element }
|
|
655
760
|
|
|
656
761
|
// Switch
|
|
657
762
|
<Den.Components.VSwitch
|
|
@@ -667,6 +772,7 @@ const [value, setValue] = useState('');
|
|
|
667
772
|
accept=".jpg,.png"
|
|
668
773
|
appearance={<UploadIcon />} // Custom trigger element
|
|
669
774
|
/>
|
|
775
|
+
// FileCategory enum available for file categories
|
|
670
776
|
|
|
671
777
|
// File with base64 output
|
|
672
778
|
<Den.Components.VBase64File
|
|
@@ -682,6 +788,9 @@ const [value, setValue] = useState('');
|
|
|
682
788
|
backgroundColor={Den.Components.ColorType.Primary}
|
|
683
789
|
frontColor={Den.Components.ColorType.White}
|
|
684
790
|
/>
|
|
791
|
+
|
|
792
|
+
// Submit wrapper (wraps custom body with hidden submit input)
|
|
793
|
+
<Den.Components.VSubmitWrapper body={<button>Custom Submit UI</button>} />
|
|
685
794
|
```
|
|
686
795
|
|
|
687
796
|
### Media Components
|
|
@@ -702,6 +811,7 @@ import IconSvg from './icon.svg';
|
|
|
702
811
|
>
|
|
703
812
|
<IconSvg />
|
|
704
813
|
</Den.Components.VSvg>
|
|
814
|
+
// SvgCategory enum available for SVG categories
|
|
705
815
|
|
|
706
816
|
// Background image
|
|
707
817
|
<Den.Components.VBackground
|
|
@@ -759,11 +869,27 @@ import IconSvg from './icon.svg';
|
|
|
759
869
|
|
|
760
870
|
```tsx
|
|
761
871
|
<Den.Components.VEllipse width="100px" height="100px" backgroundColor={Den.Components.ColorType.Primary} />
|
|
872
|
+
// EllipseCategory enum available
|
|
873
|
+
|
|
762
874
|
<Den.Components.VRectangle width="200px" height="50px" backgroundColor={Den.Components.ColorType.Info} />
|
|
875
|
+
|
|
763
876
|
<Den.Components.VLine />
|
|
877
|
+
// LineCategory enum available
|
|
878
|
+
|
|
764
879
|
<Den.Components.VShadow category={Den.Components.ShadowCategory.Small}><Content /></Den.Components.VShadow>
|
|
765
880
|
```
|
|
766
881
|
|
|
882
|
+
### VTheme (Theme Provider)
|
|
883
|
+
|
|
884
|
+
```tsx
|
|
885
|
+
<Den.Components.VTheme category={Den.Components.ThemeCategory.Light}>
|
|
886
|
+
<App />
|
|
887
|
+
</Den.Components.VTheme>
|
|
888
|
+
|
|
889
|
+
// ThemeCategory: Light, Dark (or custom)
|
|
890
|
+
// ThemeVariables type available for typed CSS variable overrides
|
|
891
|
+
```
|
|
892
|
+
|
|
767
893
|
### App-only Components (app variant)
|
|
768
894
|
|
|
769
895
|
```tsx
|
|
@@ -782,6 +908,9 @@ import IconSvg from './icon.svg';
|
|
|
782
908
|
foot={<button>Action</button>}
|
|
783
909
|
/>
|
|
784
910
|
|
|
911
|
+
// VCardSocial — social media card variant
|
|
912
|
+
<Den.Components.VCardSocial ... />
|
|
913
|
+
|
|
785
914
|
// VCardWindow — card with background image
|
|
786
915
|
<Den.Components.VCardWindow
|
|
787
916
|
backgroundUrl="/bg.jpg"
|
|
@@ -806,6 +935,21 @@ import IconSvg from './icon.svg';
|
|
|
806
935
|
|
|
807
936
|
// VTree — hierarchical tree view
|
|
808
937
|
<Den.Components.VTree nodes={treeData} />
|
|
938
|
+
// IVTreeNode type exported for tree node data structure
|
|
939
|
+
|
|
940
|
+
// VPhoto — background-image based photo with sizing
|
|
941
|
+
<Den.Components.VPhoto
|
|
942
|
+
category={Den.Components.PhotoCategory.Cover}
|
|
943
|
+
position={Den.Components.PhotoPositionType.Center}
|
|
944
|
+
src="/photo.jpg"
|
|
945
|
+
width="100%"
|
|
946
|
+
height="300px"
|
|
947
|
+
/>
|
|
948
|
+
// PhotoCategory: Auto, Contain, Cover
|
|
949
|
+
// PhotoPositionType: Left, Center, Right
|
|
950
|
+
|
|
951
|
+
// VAvatar — user avatar display
|
|
952
|
+
<Den.Components.VAvatar ... />
|
|
809
953
|
|
|
810
954
|
// VDynamic — renders component by name from registry
|
|
811
955
|
<Den.Components.VDynamic
|
|
@@ -816,6 +960,46 @@ import IconSvg from './icon.svg';
|
|
|
816
960
|
/>
|
|
817
961
|
```
|
|
818
962
|
|
|
963
|
+
### Web-only Components (web variant)
|
|
964
|
+
|
|
965
|
+
```tsx
|
|
966
|
+
// Debug utility component
|
|
967
|
+
<Den.Components.Debug ... />
|
|
968
|
+
|
|
969
|
+
// Google Font loader
|
|
970
|
+
<Den.Components.VGoogleFont
|
|
971
|
+
type={Den.Components.GoogleFontType...}
|
|
972
|
+
...
|
|
973
|
+
/>
|
|
974
|
+
// GoogleFontType, IGoogleTypeface, IGoogleFont types available
|
|
975
|
+
|
|
976
|
+
// Chrome extension validation
|
|
977
|
+
<Den.Components.VChromeExtensionValidator ... />
|
|
978
|
+
// ExtensionStatus enum exported
|
|
979
|
+
|
|
980
|
+
// Auth components
|
|
981
|
+
<Den.Components.GoogleGrant
|
|
982
|
+
category={Den.Components.GoogleGrantCategory.Implicit}
|
|
983
|
+
uxMode={Den.Components.GoogleGrantUXMode.Popup}
|
|
984
|
+
...
|
|
985
|
+
/>
|
|
986
|
+
// GoogleGrantCategory: Implicit, AuthorizationCode
|
|
987
|
+
// GoogleGrantUXMode: Popup, Redirect
|
|
988
|
+
// GoogleGrantCode, GoogleGrantToken types exported
|
|
989
|
+
|
|
990
|
+
<Den.Components.GoogleSignin
|
|
991
|
+
uxMode={Den.Components.GoogleSigninUXMode...}
|
|
992
|
+
...
|
|
993
|
+
/>
|
|
994
|
+
|
|
995
|
+
<Den.Components.FigmaSignin ... />
|
|
996
|
+
<Den.Components.WeComSignin ... />
|
|
997
|
+
|
|
998
|
+
// JWT utility
|
|
999
|
+
Den.Components.parseJWT(token) // returns IUserProfile
|
|
1000
|
+
// IUserProfile type exported
|
|
1001
|
+
```
|
|
1002
|
+
|
|
819
1003
|
### Other View Components
|
|
820
1004
|
|
|
821
1005
|
```tsx
|
|
@@ -832,11 +1016,6 @@ import IconSvg from './icon.svg';
|
|
|
832
1016
|
// Iframe
|
|
833
1017
|
<Den.Components.VFrame src="https://example.com" />
|
|
834
1018
|
|
|
835
|
-
// Theme
|
|
836
|
-
<Den.Components.VTheme category={Den.Components.ThemeCategory.Light}>
|
|
837
|
-
<App />
|
|
838
|
-
</Den.Components.VTheme>
|
|
839
|
-
|
|
840
1019
|
// Loading indicator
|
|
841
1020
|
<Den.Components.VLoading />
|
|
842
1021
|
|
|
@@ -846,6 +1025,13 @@ import IconSvg from './icon.svg';
|
|
|
846
1025
|
</Den.Components.VErrorBoundary>
|
|
847
1026
|
```
|
|
848
1027
|
|
|
1028
|
+
### Utility Functions (core)
|
|
1029
|
+
|
|
1030
|
+
```tsx
|
|
1031
|
+
// Convert FormData to nested JSON (used internally by VForm)
|
|
1032
|
+
Den.Components.convertFormDataToJson(formData)
|
|
1033
|
+
```
|
|
1034
|
+
|
|
849
1035
|
---
|
|
850
1036
|
|
|
851
1037
|
## Network Module (App/Append variants only)
|
|
@@ -857,7 +1043,7 @@ Before using network features, initialize the bootstrap:
|
|
|
857
1043
|
```tsx
|
|
858
1044
|
import { Den } from '@fewbox/den-app';
|
|
859
1045
|
|
|
860
|
-
Den.boot({
|
|
1046
|
+
Den.FewBox.boot({
|
|
861
1047
|
getToken: () => localStorage.getItem('token') || '',
|
|
862
1048
|
getAppSettings: () => ({
|
|
863
1049
|
endpoint: {
|
|
@@ -876,42 +1062,147 @@ Den.boot({
|
|
|
876
1062
|
getLanguages: (lang) => ({ /* i18n messages */ }),
|
|
877
1063
|
getHeaders: () => ({ 'X-Custom-Header': 'value' }),
|
|
878
1064
|
handleIsNotSuccessful: (data) => console.error('API error:', data),
|
|
879
|
-
handleError: (error) => console.error(error),
|
|
1065
|
+
handleError: (error) => console.error(error), // IError: { summary, data }
|
|
880
1066
|
handleWarning: (error) => console.warn(error),
|
|
881
1067
|
handleNetworkError: (error) => console.error('Network error:', error),
|
|
882
1068
|
isDebug: process.env.NODE_ENV === 'development'
|
|
883
1069
|
});
|
|
884
1070
|
|
|
885
1071
|
// Or use the Boot component:
|
|
886
|
-
<Den.Components.Boot options={bootOptions}
|
|
1072
|
+
<Den.Components.Boot options={bootOptions} />
|
|
1073
|
+
|
|
1074
|
+
// Types exported from Den.FewBox:
|
|
1075
|
+
// IFewBoxOptions, IAppSettings, IEndpoint, IError, BootClass
|
|
887
1076
|
```
|
|
888
1077
|
|
|
889
|
-
### HTTP Clients (Observable-based for Redux Observable)
|
|
1078
|
+
### Fetch-based HTTP Clients (Observable-based for Redux Observable)
|
|
890
1079
|
|
|
891
|
-
All
|
|
1080
|
+
All Fetch clients return RxJS Observables for use in Redux Observable epics:
|
|
892
1081
|
|
|
893
1082
|
```tsx
|
|
894
1083
|
import { Den } from '@fewbox/den-app';
|
|
895
1084
|
|
|
896
|
-
//
|
|
1085
|
+
// Default endpoint (uses app settings endpoint)
|
|
897
1086
|
new Den.Network.GetFetch('/users', (payload) => ({ type: 'USERS_LOADED', payload }));
|
|
898
1087
|
new Den.Network.PostFetch('/users', body, (payload) => ({ type: 'USER_CREATED', payload }));
|
|
899
1088
|
new Den.Network.PutFetch('/users/1', body, processAction);
|
|
900
1089
|
new Den.Network.PatchFetch('/users/1', body, processAction);
|
|
901
1090
|
new Den.Network.DeleteFetch('/users/1', processAction);
|
|
902
1091
|
|
|
903
|
-
// External endpoint (bypasses app settings)
|
|
1092
|
+
// External endpoint (bypasses app settings, uses named endpoint from appSettings)
|
|
904
1093
|
new Den.Network.GetFetchExternal('externalService', '/data', processAction);
|
|
1094
|
+
new Den.Network.PostFetchExternal('externalService', '/data', body, processAction);
|
|
1095
|
+
new Den.Network.PutFetchExternal('externalService', '/data/1', body, processAction);
|
|
1096
|
+
new Den.Network.PatchFetchExternal('externalService', '/data/1', body, processAction);
|
|
1097
|
+
new Den.Network.DeleteFetchExternal('externalService', '/data/1', processAction);
|
|
1098
|
+
```
|
|
1099
|
+
|
|
1100
|
+
### AJAX-based HTTP Clients
|
|
1101
|
+
|
|
1102
|
+
RxJS Ajax-based clients (alternative to Fetch):
|
|
1103
|
+
|
|
1104
|
+
```tsx
|
|
1105
|
+
// Default endpoint
|
|
1106
|
+
new Den.Network.Get('/users', processAction);
|
|
1107
|
+
new Den.Network.Post('/users', body, processAction);
|
|
1108
|
+
new Den.Network.Put('/users/1', body, processAction);
|
|
1109
|
+
new Den.Network.Patch('/users/1', body, processAction);
|
|
1110
|
+
new Den.Network.Delete('/users/1', processAction);
|
|
1111
|
+
|
|
1112
|
+
// External endpoint
|
|
1113
|
+
new Den.Network.GetExternal('externalService', '/data', processAction);
|
|
1114
|
+
new Den.Network.PostExternal('externalService', '/data', body, processAction);
|
|
1115
|
+
new Den.Network.PutExternal('externalService', '/data/1', body, processAction);
|
|
1116
|
+
new Den.Network.PatchExternal('externalService', '/data/1', body, processAction);
|
|
1117
|
+
new Den.Network.DeleteExternal('externalService', '/data/1', processAction);
|
|
1118
|
+
|
|
1119
|
+
// Text response variants (returns text instead of JSON)
|
|
1120
|
+
new Den.Network.GetText('/data', processAction);
|
|
1121
|
+
new Den.Network.PostText('/data', body, processAction);
|
|
1122
|
+
new Den.Network.PutText('/data', body, processAction);
|
|
1123
|
+
new Den.Network.PatchText('/data', body, processAction);
|
|
1124
|
+
new Den.Network.DeleteText('/data', processAction);
|
|
1125
|
+
// External text variants: GetTextExternal, PostTextExternal, PutTextExternal, PatchTextExternal, DeleteTextExternal
|
|
1126
|
+
|
|
1127
|
+
// Local storage
|
|
1128
|
+
new Den.Network.GetLocal('/local-path', processAction);
|
|
1129
|
+
```
|
|
1130
|
+
|
|
1131
|
+
### GraphQL
|
|
905
1132
|
|
|
906
|
-
|
|
1133
|
+
```tsx
|
|
1134
|
+
// Default endpoint
|
|
907
1135
|
new Den.Network.GQL({ query: 'query { users { id name } }' }, processAction);
|
|
908
|
-
new Den.Network.GQLExternal('externalService', { query: 'mutation { createUser(name: "test") { id } }' }, processAction);
|
|
909
1136
|
|
|
910
|
-
//
|
|
1137
|
+
// External endpoint
|
|
1138
|
+
new Den.Network.GQLExternal('externalService', { query: 'mutation { ... }' }, processAction);
|
|
1139
|
+
|
|
1140
|
+
// File upload
|
|
1141
|
+
new Den.Network.GQLUpload({ query: '...', variables: { file } }, processAction);
|
|
1142
|
+
new Den.Network.GQLExternalUpload('externalService', { query: '...' }, processAction);
|
|
1143
|
+
|
|
1144
|
+
// IGraphQL type available for query/mutation objects
|
|
1145
|
+
```
|
|
1146
|
+
|
|
1147
|
+
### Server-Sent Events (SSE)
|
|
1148
|
+
|
|
1149
|
+
```tsx
|
|
911
1150
|
new Den.Network.GetSSE('/events', processAction);
|
|
1151
|
+
new Den.Network.PostSSE('/events', processAction);
|
|
1152
|
+
new Den.Network.GetSSEExternal('externalService', '/events', processAction);
|
|
1153
|
+
new Den.Network.PostSSEExternal('externalService', '/events', processAction);
|
|
1154
|
+
```
|
|
1155
|
+
|
|
1156
|
+
### WebSocket
|
|
912
1157
|
|
|
913
|
-
|
|
1158
|
+
```tsx
|
|
914
1159
|
new Den.Network.WS({ url: 'wss://example.com/ws' });
|
|
1160
|
+
// Den.Network.ws() function also available
|
|
1161
|
+
// IWebsocketOptions type exported
|
|
1162
|
+
```
|
|
1163
|
+
|
|
1164
|
+
### Promise-based HTTP (non-Observable)
|
|
1165
|
+
|
|
1166
|
+
For use outside Redux Observable epics:
|
|
1167
|
+
|
|
1168
|
+
```tsx
|
|
1169
|
+
// Default endpoint
|
|
1170
|
+
Den.Network.verbsGetPromise('/users');
|
|
1171
|
+
Den.Network.verbsPostPromise('/users', body);
|
|
1172
|
+
Den.Network.verbsPutPromise('/users/1', body);
|
|
1173
|
+
Den.Network.verbsPatchPromise('/users/1', body);
|
|
1174
|
+
Den.Network.verbsDeletePromise('/users/1');
|
|
1175
|
+
|
|
1176
|
+
// External endpoint
|
|
1177
|
+
Den.Network.verbsGetPromiseExternal('externalService', '/data');
|
|
1178
|
+
Den.Network.verbsPostPromiseExternal('externalService', '/data', body);
|
|
1179
|
+
Den.Network.verbsPutPromiseExternal('externalService', '/data/1', body);
|
|
1180
|
+
Den.Network.verbsPatchPromiseExternal('externalService', '/data/1', body);
|
|
1181
|
+
Den.Network.verbsDeletePromiseExternal('externalService', '/data/1');
|
|
1182
|
+
```
|
|
1183
|
+
|
|
1184
|
+
### Raw HTTP Verb Functions
|
|
1185
|
+
|
|
1186
|
+
Low-level verb functions that return Observables:
|
|
1187
|
+
|
|
1188
|
+
```tsx
|
|
1189
|
+
// Default: verbsGet, verbsPost, verbsPut, verbsPatch, verbsDelete
|
|
1190
|
+
// External: verbsGetExternal, verbsPostExternal, verbsPutExternal, verbsPatchExternal, verbsDeleteExternal
|
|
1191
|
+
// Internal: _verbsGet, _verbsPost, _verbsPut, _verbsPatch, _verbsDelete (with custom headers)
|
|
1192
|
+
// Internal Promise: _verbsGetPromise, _verbsPostPromise, etc.
|
|
1193
|
+
```
|
|
1194
|
+
|
|
1195
|
+
### Network Utilities
|
|
1196
|
+
|
|
1197
|
+
```tsx
|
|
1198
|
+
Den.Network.buildHeaders(customHeaders); // Merge custom headers with JWT token
|
|
1199
|
+
Den.Network.buildUrl(path); // Build URL from app settings endpoint
|
|
1200
|
+
Den.Network.buildExternalUrl(externalName, path); // Build URL from named external endpoint
|
|
1201
|
+
Den.Network.JsonHeaders; // Default JSON content-type headers
|
|
1202
|
+
Den.Network.parseAjaxData(response); // Parse AJAX response
|
|
1203
|
+
Den.Network.parseFetchData(response); // Parse Fetch response
|
|
1204
|
+
Den.Network.parseGQLAjaxData(response); // Parse GraphQL response
|
|
1205
|
+
Den.Network.convertJsonToGraphQLSchema(json); // Convert JSON to GraphQL schema string
|
|
915
1206
|
```
|
|
916
1207
|
|
|
917
1208
|
### Redux Observable Epic Pattern
|
|
@@ -940,6 +1231,50 @@ const fetchUsersEpic = (action$) =>
|
|
|
940
1231
|
|
|
941
1232
|
---
|
|
942
1233
|
|
|
1234
|
+
## Store Module (App/Append variants only)
|
|
1235
|
+
|
|
1236
|
+
Type definitions for Redux store integration:
|
|
1237
|
+
|
|
1238
|
+
```tsx
|
|
1239
|
+
import { Den } from '@fewbox/den-app';
|
|
1240
|
+
|
|
1241
|
+
// Pagination
|
|
1242
|
+
type IList = Den.Store.IList; // List response wrapper
|
|
1243
|
+
type IPaging = Den.Store.IPaging; // Paged list with page/size
|
|
1244
|
+
type IContinuePaging = Den.Store.IContinuePaging; // Cursor-based pagination
|
|
1245
|
+
|
|
1246
|
+
// Data types
|
|
1247
|
+
type Json = Den.Store.Json; // Generic JSON type
|
|
1248
|
+
type EnumDictionary<K, V> = Den.Store.EnumDictionary<K, V>; // Enum-keyed dictionary
|
|
1249
|
+
|
|
1250
|
+
// Response wrappers
|
|
1251
|
+
type IMetaResponse = Den.Store.IMetaResponse; // Response with metadata
|
|
1252
|
+
type IPayloadResponse = Den.Store.IPayloadResponse; // Response with payload
|
|
1253
|
+
```
|
|
1254
|
+
|
|
1255
|
+
---
|
|
1256
|
+
|
|
1257
|
+
## Language Module (App/Append variants only)
|
|
1258
|
+
|
|
1259
|
+
Internationalization utilities:
|
|
1260
|
+
|
|
1261
|
+
```tsx
|
|
1262
|
+
import { Den } from '@fewbox/den-app';
|
|
1263
|
+
|
|
1264
|
+
// Get browser language
|
|
1265
|
+
Den.Language.getBrowserLang(); // "en" (short code)
|
|
1266
|
+
Den.Language.getBrowserLangFull(); // "en-US" (full code)
|
|
1267
|
+
|
|
1268
|
+
// Get formatted intl message (uses BootClass language config)
|
|
1269
|
+
Den.Language.getIntlMessage('Hello.World', 'en', { name: 'World' });
|
|
1270
|
+
|
|
1271
|
+
// Select messages for a locale from a locales object
|
|
1272
|
+
const messages = Den.Language.language(locales, 'en');
|
|
1273
|
+
const messagesFull = Den.Language.languageFull(locales, 'en-US');
|
|
1274
|
+
```
|
|
1275
|
+
|
|
1276
|
+
---
|
|
1277
|
+
|
|
943
1278
|
## Styling Guide
|
|
944
1279
|
|
|
945
1280
|
### CSS Variables
|
|
@@ -969,14 +1304,6 @@ ExceptTop, ExceptRight, ExceptBottom, ExceptLeft,
|
|
|
969
1304
|
RightTop, RightBottom, LeftTop, LeftBottom, TopBottom, LeftRight
|
|
970
1305
|
```
|
|
971
1306
|
|
|
972
|
-
### Border Radius (BorderRadiusType)
|
|
973
|
-
|
|
974
|
-
```tsx
|
|
975
|
-
Den.Components.BorderRadiusType.Default // default radius from CSS variable
|
|
976
|
-
Den.Components.BorderRadiusType.Fixed // fixed radius
|
|
977
|
-
Den.Components.BorderRadiusType.Max // maximum rounding (pill shape)
|
|
978
|
-
```
|
|
979
|
-
|
|
980
1307
|
---
|
|
981
1308
|
|
|
982
1309
|
## Common Patterns
|
|
@@ -1035,7 +1362,7 @@ Den.Components.BorderRadiusType.Max // maximum rounding (pill shape)
|
|
|
1035
1362
|
```tsx
|
|
1036
1363
|
<Den.Components.VForm
|
|
1037
1364
|
handleSubmit={(data) => api.login(data.form)}
|
|
1038
|
-
handleValidateError={(
|
|
1365
|
+
handleValidateError={(invalidInputs) => { invalidInputs[0]?.focus(); }}>
|
|
1039
1366
|
<Den.Components.Y gap="1em" padding="2em">
|
|
1040
1367
|
<Den.Components.VEmail name="form.email" required placeholder="Email" label="Email" />
|
|
1041
1368
|
<Den.Components.VPassword name="form.password" required minLength={8} placeholder="Password" label="Password" />
|
|
@@ -1084,7 +1411,7 @@ Den.Components.BorderRadiusType.Max // maximum rounding (pill shape)
|
|
|
1084
1411
|
|
|
1085
1412
|
```tsx
|
|
1086
1413
|
<Den.Components.Responsive
|
|
1087
|
-
breakpointType={Den.Components.
|
|
1414
|
+
breakpointType={Den.Components.ScreenSizeType.Medium}
|
|
1088
1415
|
desktop={<Den.Components.X gap="1em">
|
|
1089
1416
|
<Sidebar />
|
|
1090
1417
|
<MainContent />
|
|
@@ -1107,5 +1434,7 @@ Den.Components.BorderRadiusType.Max // maximum rounding (pill shape)
|
|
|
1107
1434
|
6. `selfGrow={1}` fills remaining space (flex-grow: 1).
|
|
1108
1435
|
7. VBoundary is the safe default container.
|
|
1109
1436
|
8. All components forward standard HTML attributes (onClick, id, aria-*, data-*).
|
|
1110
|
-
9.
|
|
1437
|
+
9. BreakpointDisplay/PositionArea use `cloneElement` — children must accept `className` prop.
|
|
1111
1438
|
10. Use `height`/`width` as direct props (not in `style`) for highest CSS priority.
|
|
1439
|
+
11. Use preset enums (PaddingType, MarginType, etc.) for consistent spacing, or pass custom strings.
|
|
1440
|
+
12. Pseudo element styling is available via `pseudoType`, `pseudoFrontColor`, `pseudoBackgroundColor`, `pseudoBorderColor` props.
|