@umbra.ui/core 0.4.6 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/inputs/InputCard/InputCard.vue +46 -9
- package/dist/components/inputs/InputCryptoAddress/InputCryptoAddress.vue +23 -4
- package/dist/components/inputs/InputEmail/InputEmail.vue +14 -7
- package/dist/components/inputs/InputNumber/InputNumber.vue +36 -3
- package/dist/components/inputs/InputPhone/InputPhone.vue +36 -3
- package/dist/components/inputs/InputSecure/InputSecure.vue +27 -3
- package/dist/components/pickers/CollectionPicker/CollectionPicker.vue +31 -9
- package/dist/components/pickers/CollectionPicker/README.md +50 -0
- package/dist/components/pickers/ColorPicker/ColorPicker.vue +27 -4
- package/dist/components/pickers/ColorPicker/README.md +50 -0
- package/dist/components/pickers/IconPicker/IconPicker.vue +53 -26
- package/dist/components/pickers/IconPicker/README.md +43 -0
- package/package.json +5 -4
- package/src/components/inputs/InputCard/InputCard.vue +46 -9
- package/src/components/inputs/InputCryptoAddress/InputCryptoAddress.vue +23 -4
- package/src/components/inputs/InputEmail/InputEmail.vue +14 -7
- package/src/components/inputs/InputNumber/InputNumber.vue +36 -3
- package/src/components/inputs/InputPhone/InputPhone.vue +36 -3
- package/src/components/inputs/InputSecure/InputSecure.vue +27 -3
- package/src/components/pickers/CollectionPicker/CollectionPicker.vue +31 -9
- package/src/components/pickers/CollectionPicker/README.md +50 -0
- package/src/components/pickers/ColorPicker/ColorPicker.vue +27 -4
- package/src/components/pickers/ColorPicker/README.md +50 -0
- package/src/components/pickers/IconPicker/IconPicker.vue +53 -26
- package/src/components/pickers/IconPicker/README.md +43 -0
- package/src/skills/README.md +108 -0
- package/src/skills/umbra.ui-colors-application/SKILL.md +102 -0
- package/src/skills/umbra.ui-colors-application/reference.md +178 -0
- package/src/skills/umbra.ui-control-button/SKILL.md +34 -0
- package/src/skills/umbra.ui-control-checkbox/SKILL.md +34 -0
- package/src/skills/umbra.ui-control-dropdown/SKILL.md +34 -0
- package/src/skills/umbra.ui-control-icon-button/SKILL.md +33 -0
- package/src/skills/umbra.ui-control-inline-dropdown/SKILL.md +32 -0
- package/src/skills/umbra.ui-control-radio/SKILL.md +33 -0
- package/src/skills/umbra.ui-control-range-slider/SKILL.md +33 -0
- package/src/skills/umbra.ui-control-segmented-control/SKILL.md +33 -0
- package/src/skills/umbra.ui-control-slider/SKILL.md +33 -0
- package/src/skills/umbra.ui-control-stepper/SKILL.md +33 -0
- package/src/skills/umbra.ui-control-switch/SKILL.md +33 -0
- package/src/skills/umbra.ui-dialog-alert/SKILL.md +34 -0
- package/src/skills/umbra.ui-dialog-toast/SKILL.md +35 -0
- package/src/skills/umbra.ui-indicator-progress-bar/SKILL.md +33 -0
- package/src/skills/umbra.ui-indicator-tooltip/SKILL.md +33 -0
- package/src/skills/umbra.ui-input-card/SKILL.md +42 -0
- package/src/skills/umbra.ui-input-card/reference.md +36 -0
- package/src/skills/umbra.ui-input-crypto-address/SKILL.md +40 -0
- package/src/skills/umbra.ui-input-crypto-address/reference.md +40 -0
- package/src/skills/umbra.ui-input-email/SKILL.md +45 -0
- package/src/skills/umbra.ui-input-number/SKILL.md +39 -0
- package/src/skills/umbra.ui-input-otp/SKILL.md +44 -0
- package/src/skills/umbra.ui-input-phone/SKILL.md +45 -0
- package/src/skills/umbra.ui-input-phone/reference.md +35 -0
- package/src/skills/umbra.ui-input-search/SKILL.md +43 -0
- package/src/skills/umbra.ui-input-search/reference.md +45 -0
- package/src/skills/umbra.ui-input-secure/SKILL.md +43 -0
- package/src/skills/umbra.ui-input-secure/reference.md +44 -0
- package/src/skills/umbra.ui-input-string-capture/SKILL.md +41 -0
- package/src/skills/umbra.ui-input-tags/SKILL.md +46 -0
- package/src/skills/umbra.ui-input-tags/reference.md +44 -0
- package/src/skills/umbra.ui-input-text/SKILL.md +46 -0
- package/src/skills/umbra.ui-menu-action-menu/SKILL.md +34 -0
- package/src/skills/umbra.ui-model-popover/SKILL.md +35 -0
- package/src/skills/umbra.ui-model-sheet/SKILL.md +35 -0
- package/src/skills/umbra.ui-model-sidebar/SKILL.md +35 -0
- package/src/skills/umbra.ui-picker-collection/SKILL.md +36 -0
- package/src/skills/umbra.ui-picker-collection/reference.md +34 -0
- package/src/skills/umbra.ui-picker-color/SKILL.md +36 -0
- package/src/skills/umbra.ui-picker-color/reference.md +34 -0
- package/src/skills/umbra.ui-picker-date/SKILL.md +36 -0
- package/src/skills/umbra.ui-picker-date/reference.md +26 -0
- package/src/skills/umbra.ui-picker-file/SKILL.md +42 -0
- package/src/skills/umbra.ui-picker-file/reference.md +39 -0
- package/src/skills/umbra.ui-picker-icon/SKILL.md +36 -0
- package/src/skills/umbra.ui-picker-icon/reference.md +28 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Umbra Skill: SegmentedControl
|
|
2
|
+
|
|
3
|
+
Use this skill for compact single-choice switching with Umbra `SegmentedControl`.
|
|
4
|
+
|
|
5
|
+
## When To Use
|
|
6
|
+
- View mode toggles (grid/list/card).
|
|
7
|
+
- Filter tabs and sub-mode selectors.
|
|
8
|
+
- Settings where immediate choice switching is desired.
|
|
9
|
+
|
|
10
|
+
## Required Context Checklist
|
|
11
|
+
- Segment `items: ControlItem[]`.
|
|
12
|
+
- Selected index state and default.
|
|
13
|
+
- Side effects when selected segment changes.
|
|
14
|
+
- Disabled segment handling if applicable.
|
|
15
|
+
|
|
16
|
+
## Ask Developer If Missing
|
|
17
|
+
- "What options should each segment show?"
|
|
18
|
+
- "Which segment is default-selected?"
|
|
19
|
+
- "Do we trigger behavior on click or only on index update?"
|
|
20
|
+
|
|
21
|
+
## Implementation Recipe
|
|
22
|
+
1. Import `SegmentedControl`.
|
|
23
|
+
2. Define segment items and `selectedIndex`.
|
|
24
|
+
3. Render with `:items` and `:selected-index`.
|
|
25
|
+
4. Handle `@update:selected-index` and/or `@click`.
|
|
26
|
+
|
|
27
|
+
## Validation And Edge Cases
|
|
28
|
+
- Keep selection index valid when items are dynamic.
|
|
29
|
+
- Avoid expensive side effects on every toggle if not needed.
|
|
30
|
+
- Verify text remains readable across themes.
|
|
31
|
+
|
|
32
|
+
## Definition Of Done
|
|
33
|
+
- Segment switching is smooth and updates app state correctly.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Umbra Skill: Slider
|
|
2
|
+
|
|
3
|
+
Use this skill for single-value continuous selection with Umbra `Slider`.
|
|
4
|
+
|
|
5
|
+
## When To Use
|
|
6
|
+
- Percent-like settings (volume, opacity, confidence).
|
|
7
|
+
- Numeric tuning in bounded ranges.
|
|
8
|
+
- Visual controls where drag is more natural than text input.
|
|
9
|
+
|
|
10
|
+
## Required Context Checklist
|
|
11
|
+
- Boundaries (`min`, `max`) and current `value`.
|
|
12
|
+
- Style variant (`default`, `capline`, `capsule`).
|
|
13
|
+
- Value formatting for nearby labels/hints.
|
|
14
|
+
- Persistence and debounce strategy if updates are frequent.
|
|
15
|
+
|
|
16
|
+
## Ask Developer If Missing
|
|
17
|
+
- "What min/max/value range should be used?"
|
|
18
|
+
- "Should changes apply live while dragging?"
|
|
19
|
+
- "Which slider style best matches this surface?"
|
|
20
|
+
|
|
21
|
+
## Implementation Recipe
|
|
22
|
+
1. Import `Slider`.
|
|
23
|
+
2. Maintain parent-controlled numeric `value`.
|
|
24
|
+
3. Render with range + style props.
|
|
25
|
+
4. Handle `@update:value` and sync to store/form.
|
|
26
|
+
|
|
27
|
+
## Validation And Edge Cases
|
|
28
|
+
- Clamp external values before rendering.
|
|
29
|
+
- Handle decimal values deliberately if range needs precision.
|
|
30
|
+
- Verify touch dragging on mobile.
|
|
31
|
+
|
|
32
|
+
## Definition Of Done
|
|
33
|
+
- Slider tracks the expected value and updates reliably in app state.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Umbra Skill: Stepper
|
|
2
|
+
|
|
3
|
+
Use this skill for bounded increment/decrement numeric inputs with Umbra `Stepper`.
|
|
4
|
+
|
|
5
|
+
## When To Use
|
|
6
|
+
- Quantity controls, counters, and integer configs.
|
|
7
|
+
- Inputs where explicit step increments are required.
|
|
8
|
+
- Numeric forms where free text entry is not preferred.
|
|
9
|
+
|
|
10
|
+
## Required Context Checklist
|
|
11
|
+
- Controlled `value` binding.
|
|
12
|
+
- Limits (`min`, `max`) and `step` size.
|
|
13
|
+
- Integer vs decimal expectations.
|
|
14
|
+
- Interaction with sibling controls (totals, pricing, validation).
|
|
15
|
+
|
|
16
|
+
## Ask Developer If Missing
|
|
17
|
+
- "What are min/max/step rules?"
|
|
18
|
+
- "Should decimal steps be allowed?"
|
|
19
|
+
- "What state updates when value changes?"
|
|
20
|
+
|
|
21
|
+
## Implementation Recipe
|
|
22
|
+
1. Import `Stepper`.
|
|
23
|
+
2. Render with `:value`, `:min`, `:max`, `:step`.
|
|
24
|
+
3. Handle `@update:value` and persist.
|
|
25
|
+
4. Add surrounding label/context for meaning of the number.
|
|
26
|
+
|
|
27
|
+
## Validation And Edge Cases
|
|
28
|
+
- Keep model value clamped to min/max.
|
|
29
|
+
- Watch for floating point precision if decimal step is used.
|
|
30
|
+
- Prevent downstream logic from assuming unrestricted values.
|
|
31
|
+
|
|
32
|
+
## Definition Of Done
|
|
33
|
+
- Stepper changes value predictably and respects configured bounds.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Umbra Skill: Switch
|
|
2
|
+
|
|
3
|
+
Use this skill for binary on/off settings with Umbra `Switch`.
|
|
4
|
+
|
|
5
|
+
## When To Use
|
|
6
|
+
- Feature toggles and preferences.
|
|
7
|
+
- Enable/disable behavior flags in settings forms.
|
|
8
|
+
- Boolean values that benefit from immediate visual state.
|
|
9
|
+
|
|
10
|
+
## Required Context Checklist
|
|
11
|
+
- Controlled boolean source (`isChecked`).
|
|
12
|
+
- Visual mode (`switchType`) and size.
|
|
13
|
+
- Checked color requirements (default vs custom color).
|
|
14
|
+
- Side effects when toggled.
|
|
15
|
+
|
|
16
|
+
## Ask Developer If Missing
|
|
17
|
+
- "What boolean field should this control?"
|
|
18
|
+
- "Default or outline style?"
|
|
19
|
+
- "Any custom on-color needed for semantic meaning?"
|
|
20
|
+
|
|
21
|
+
## Implementation Recipe
|
|
22
|
+
1. Import `Switch`.
|
|
23
|
+
2. Bind with `:is-checked`.
|
|
24
|
+
3. Handle `@update:is-checked` and persist value.
|
|
25
|
+
4. Place clear label text adjacent to switch.
|
|
26
|
+
|
|
27
|
+
## Validation And Edge Cases
|
|
28
|
+
- Ensure toggling cannot desync from external state.
|
|
29
|
+
- Handle disabled/permission scenarios at parent level if needed.
|
|
30
|
+
- Verify switch remains understandable in both themes.
|
|
31
|
+
|
|
32
|
+
## Definition Of Done
|
|
33
|
+
- Toggle reflects and updates boolean state correctly.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Umbra Skill: Alert
|
|
2
|
+
|
|
3
|
+
Use this skill for blocking confirmation/info dialogs with Umbra `Alert`.
|
|
4
|
+
|
|
5
|
+
## When To Use
|
|
6
|
+
- Confirm destructive or irreversible actions.
|
|
7
|
+
- Present important messages requiring explicit acknowledgment.
|
|
8
|
+
- Offer 1..N dialog actions with semantic action types.
|
|
9
|
+
|
|
10
|
+
## Required Context Checklist
|
|
11
|
+
- Visibility source of truth (`show` boolean).
|
|
12
|
+
- Alert copy (`title`, `description`).
|
|
13
|
+
- Action list (`AlertAction[]`) and action ordering.
|
|
14
|
+
- Behavior on close (`update:show`) and side effects per action.
|
|
15
|
+
|
|
16
|
+
## Ask Developer If Missing
|
|
17
|
+
- "Is this confirm/cancel only, or multi-option?"
|
|
18
|
+
- "Which action is destructive and should be emphasized?"
|
|
19
|
+
- "Should dialog close automatically after each action?"
|
|
20
|
+
|
|
21
|
+
## Implementation Recipe
|
|
22
|
+
1. Import `Alert` and `AlertAction`.
|
|
23
|
+
2. Manage `showAlert` state in parent.
|
|
24
|
+
3. Define typed `actions` with `title`, `type`, and `action`.
|
|
25
|
+
4. Render `<Alert :show ... :actions ... @update:show="...">`.
|
|
26
|
+
5. Ensure each action updates dialog state as intended.
|
|
27
|
+
|
|
28
|
+
## Validation And Edge Cases
|
|
29
|
+
- Do not allow hidden destructive behavior behind neutral labels.
|
|
30
|
+
- Make sure `update:show` keeps parent and UI synchronized.
|
|
31
|
+
- Keep descriptions concise and explicit for high-risk actions.
|
|
32
|
+
|
|
33
|
+
## Definition Of Done
|
|
34
|
+
- Alert messaging and action semantics are correct and safe.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Umbra Skill: Toast
|
|
2
|
+
|
|
3
|
+
Use this skill for non-blocking user feedback with Umbra toast system.
|
|
4
|
+
|
|
5
|
+
## When To Use
|
|
6
|
+
- Success/error/warning/info feedback after user actions.
|
|
7
|
+
- Background process updates that should not block interaction.
|
|
8
|
+
- Temporary notices with optional actions.
|
|
9
|
+
|
|
10
|
+
## Required Context Checklist
|
|
11
|
+
- Plugin setup (`ToastPlugin`) and `<ToastContainer />` mounting.
|
|
12
|
+
- Invocation style (`useToast` helpers vs `addToast`).
|
|
13
|
+
- Toast type, duration, dismissibility, and position.
|
|
14
|
+
- Whether actions are needed inside the toast.
|
|
15
|
+
|
|
16
|
+
## Ask Developer If Missing
|
|
17
|
+
- "Is ToastPlugin already installed at app root?"
|
|
18
|
+
- "Where is ToastContainer rendered?"
|
|
19
|
+
- "Should this message auto-dismiss, and after how long?"
|
|
20
|
+
- "Do we need CTA actions in the toast?"
|
|
21
|
+
|
|
22
|
+
## Implementation Recipe
|
|
23
|
+
1. Ensure app installs `ToastPlugin`.
|
|
24
|
+
2. Ensure a `ToastContainer` exists in app shell.
|
|
25
|
+
3. In feature code, call `useToast()`.
|
|
26
|
+
4. Prefer `showSuccess/showError/showWarning/showInfo` for standard cases.
|
|
27
|
+
5. Use `addToast` for advanced cases (custom type, actions, persistent toasts).
|
|
28
|
+
|
|
29
|
+
## Validation And Edge Cases
|
|
30
|
+
- Avoid spam: debounce repetitive toasts from rapid events.
|
|
31
|
+
- Use `duration: 0` only when persistent toast is truly required.
|
|
32
|
+
- Ensure critical errors are not toast-only if they require explicit user action.
|
|
33
|
+
|
|
34
|
+
## Definition Of Done
|
|
35
|
+
- Toasts render with correct type/style/timing and are actionable when needed.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Umbra Skill: ProgressBar
|
|
2
|
+
|
|
3
|
+
Use this skill for visual progress feedback with Umbra `ProgressBar`.
|
|
4
|
+
|
|
5
|
+
## When To Use
|
|
6
|
+
- Upload/download progress.
|
|
7
|
+
- Multi-step flow completion indicators.
|
|
8
|
+
- Background task progress where users need status visibility.
|
|
9
|
+
|
|
10
|
+
## Required Context Checklist
|
|
11
|
+
- Progress source value and update cadence.
|
|
12
|
+
- Bar style (`default`, `capsule`, `capline`).
|
|
13
|
+
- Color and height requirements.
|
|
14
|
+
- Whether to clamp, round, or debounce progress updates.
|
|
15
|
+
|
|
16
|
+
## Ask Developer If Missing
|
|
17
|
+
- "What data source drives progress?"
|
|
18
|
+
- "Which visual style should be used?"
|
|
19
|
+
- "Do we need custom colors to match status semantics?"
|
|
20
|
+
|
|
21
|
+
## Implementation Recipe
|
|
22
|
+
1. Import `ProgressBar`.
|
|
23
|
+
2. Bind `:progress` from parent state/store.
|
|
24
|
+
3. Configure `barType`, colors, and `height` if needed.
|
|
25
|
+
4. Update progress from task events and keep values in 0-100.
|
|
26
|
+
|
|
27
|
+
## Validation And Edge Cases
|
|
28
|
+
- Prevent regressions from stale async events.
|
|
29
|
+
- Verify behavior at boundaries (0, 100).
|
|
30
|
+
- Keep screen reader text nearby for critical workflows.
|
|
31
|
+
|
|
32
|
+
## Definition Of Done
|
|
33
|
+
- Progress reflects real task state and is visually consistent.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Umbra Skill: Tooltip
|
|
2
|
+
|
|
3
|
+
Use this skill for contextual hover help with Umbra tooltip system.
|
|
4
|
+
|
|
5
|
+
## When To Use
|
|
6
|
+
- Inline help for controls, icons, and dense interfaces.
|
|
7
|
+
- Explain disabled states or ambiguous actions.
|
|
8
|
+
- Provide non-blocking guidance near interactive elements.
|
|
9
|
+
|
|
10
|
+
## Required Context Checklist
|
|
11
|
+
- App-level `TooltipProvider` presence.
|
|
12
|
+
- Usage mode: `v-tooltip` directive vs `useTooltip` composable.
|
|
13
|
+
- Tooltip content, placement, delay, and offset.
|
|
14
|
+
- Accessibility expectations and fallback text placement.
|
|
15
|
+
|
|
16
|
+
## Ask Developer If Missing
|
|
17
|
+
- "Is `TooltipProvider` already mounted in app shell?"
|
|
18
|
+
- "Should we use directive syntax or programmatic binding?"
|
|
19
|
+
- "What placement and delay feel best for this surface?"
|
|
20
|
+
|
|
21
|
+
## Implementation Recipe
|
|
22
|
+
1. Ensure `<TooltipProvider />` exists at app level.
|
|
23
|
+
2. For simple cases, apply `v-tooltip` to target element.
|
|
24
|
+
3. For dynamic/programmatic cases, use `useTooltip` and `bindTooltip`.
|
|
25
|
+
4. Configure `content`, `placement`, `delay`, and `offset`.
|
|
26
|
+
|
|
27
|
+
## Validation And Edge Cases
|
|
28
|
+
- Avoid tooltip-only critical information.
|
|
29
|
+
- Verify on mobile/ touch-only contexts where hover is limited.
|
|
30
|
+
- Confirm tooltip positioning in scrollable/overflow containers.
|
|
31
|
+
|
|
32
|
+
## Definition Of Done
|
|
33
|
+
- Tooltip appears with correct content/timing/placement and does not obstruct interaction.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Umbra Skill: InputCard
|
|
2
|
+
|
|
3
|
+
Use this skill for credit-card number entry with card detection, masking, and validity emission.
|
|
4
|
+
|
|
5
|
+
## When To Use
|
|
6
|
+
- You need card-number capture with brand detection.
|
|
7
|
+
- You need formatted display plus raw digit emission.
|
|
8
|
+
- You need validity signal for payment submit gating.
|
|
9
|
+
|
|
10
|
+
## Required Context Checklist
|
|
11
|
+
- Exact mount location and form context (checkout, saved card, etc.).
|
|
12
|
+
- Raw vs formatted storage requirement in parent.
|
|
13
|
+
- Whether card brand UI should be shown.
|
|
14
|
+
- Submit gating behavior using `update:valid`.
|
|
15
|
+
- External payment-provider error handling with parent `state='error'`.
|
|
16
|
+
|
|
17
|
+
## Ask Developer If Missing
|
|
18
|
+
- "Should parent store raw digits (`update:value`) or formatted string?"
|
|
19
|
+
- "Do we show card type icon (`showCardType`) in this surface?"
|
|
20
|
+
- "What should happen when `update:valid` is false at submit?"
|
|
21
|
+
- "Any gateway/server error state to map to `state='error'`?"
|
|
22
|
+
|
|
23
|
+
## Implementation Recipe
|
|
24
|
+
1. Import `InputCard`.
|
|
25
|
+
2. Bind:
|
|
26
|
+
- `v-model:value="cardDigits"`
|
|
27
|
+
- optional `@update:formatted`, `@update:cardType`, `@update:valid`
|
|
28
|
+
3. Use `cardValid` to gate submit actions.
|
|
29
|
+
4. Keep CVV/expiry/zip as separate fields.
|
|
30
|
+
5. Keep parent business errors separate via `state='error'`.
|
|
31
|
+
|
|
32
|
+
## Validation And Edge Cases
|
|
33
|
+
- Input should reject over-length card numbers.
|
|
34
|
+
- Internal error should show on blur for non-empty invalid input.
|
|
35
|
+
- Error should hide while focused and editing.
|
|
36
|
+
- Paste should sanitize and clamp to supported format length.
|
|
37
|
+
|
|
38
|
+
## Definition Of Done
|
|
39
|
+
- Card input clamps to valid lengths for detected card patterns.
|
|
40
|
+
- Emitted raw/formatted/cardType/valid events are consumed correctly.
|
|
41
|
+
- Blur-only internal error behavior is consistent and non-noisy.
|
|
42
|
+
- Parent/server errors still render immediately via `state='error'`.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Reference: InputCard
|
|
2
|
+
|
|
3
|
+
Source of truth:
|
|
4
|
+
- `packages/core/src/components/inputs/InputCard/InputCard.vue`
|
|
5
|
+
- `packages/core/src/components/inputs/InputCard/README.md`
|
|
6
|
+
|
|
7
|
+
## Public Props
|
|
8
|
+
- `value?: string` (raw digits expected for controlled usage)
|
|
9
|
+
- `placeholder?: string`
|
|
10
|
+
- `showCardType?: boolean` (default `true`)
|
|
11
|
+
- `state?: "normal" | "active" | "disabled" | "readonly" | "error"`
|
|
12
|
+
|
|
13
|
+
## Emitted Events
|
|
14
|
+
- `update:value` -> normalized raw digits
|
|
15
|
+
- `update:formatted` -> formatted display value
|
|
16
|
+
- `update:cardType` -> detected card name string
|
|
17
|
+
- `update:valid` -> `true` when complete and valid
|
|
18
|
+
|
|
19
|
+
## Validation/Formatting Notes
|
|
20
|
+
- Card type detection uses prefix patterns (visa/mastercard/amex/discover/diners/jcb).
|
|
21
|
+
- Luhn algorithm validates completed card numbers.
|
|
22
|
+
- Over-length protection is enforced in beforeinput/input/paste paths.
|
|
23
|
+
- Current Visa config is 16-digit only.
|
|
24
|
+
- Internal invalid state is blur-gated for non-empty invalid input.
|
|
25
|
+
- Parent `state="error"` is immediate.
|
|
26
|
+
|
|
27
|
+
## Integration Pitfalls
|
|
28
|
+
- Do not re-inject stale longer values from parent into `v-model:value`.
|
|
29
|
+
- For submit readiness, combine card validity with other payment fields.
|
|
30
|
+
- Keep CVV/expiry validation external; this component only handles card number.
|
|
31
|
+
|
|
32
|
+
## Agent Verification Checklist
|
|
33
|
+
- Cannot enter more digits than allowed by detected format.
|
|
34
|
+
- Pasting too many digits clamps correctly.
|
|
35
|
+
- Invalid non-empty card shows error on blur, not while focused typing.
|
|
36
|
+
- Parent `state="error"` overrides internal timing.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Umbra Skill: InputCryptoAddress
|
|
2
|
+
|
|
3
|
+
Use this skill for blockchain address entry with chain-specific validation and optional known-address selection.
|
|
4
|
+
|
|
5
|
+
## When To Use
|
|
6
|
+
- You need ETH/BTC/SOL address input with inline validity feedback.
|
|
7
|
+
- You need optional known-address dropdown selection.
|
|
8
|
+
- You need custom validator override for chain/app-specific checks.
|
|
9
|
+
|
|
10
|
+
## Required Context Checklist
|
|
11
|
+
- Which chain is required (`eth`, `btc`, `sol`).
|
|
12
|
+
- Whether known addresses should be provided.
|
|
13
|
+
- How selected/typed address maps to app state.
|
|
14
|
+
- Whether custom validator is needed.
|
|
15
|
+
- Parent error handling requirements.
|
|
16
|
+
|
|
17
|
+
## Ask Developer If Missing
|
|
18
|
+
- "Which chain should validation target?"
|
|
19
|
+
- "Do you have a known-address list (label + address) for dropdown selection?"
|
|
20
|
+
- "Should we use default validation or provide a custom validator?"
|
|
21
|
+
- "What should happen after selecting a known address (auto-submit, stay editable, etc.)?"
|
|
22
|
+
|
|
23
|
+
## Implementation Recipe
|
|
24
|
+
1. Import `InputCryptoAddress`.
|
|
25
|
+
2. Bind `v-model:value` to address state.
|
|
26
|
+
3. Pass required `chain`.
|
|
27
|
+
4. Optionally pass `knownAddresses`, `knownAddressesLabel`, and `validator`.
|
|
28
|
+
5. Handle submit/action based on resolved address from the bound model.
|
|
29
|
+
|
|
30
|
+
## Validation And Edge Cases
|
|
31
|
+
- Invalid internal state should appear on blur, not during active typing.
|
|
32
|
+
- Valid status should still render when value is valid.
|
|
33
|
+
- Known-address dropdown should not break focus/blur flow.
|
|
34
|
+
- Ensure trim/normalization behavior matches backend expectations.
|
|
35
|
+
|
|
36
|
+
## Definition Of Done
|
|
37
|
+
- Chain-appropriate validation is active.
|
|
38
|
+
- Known-address selection updates bound model correctly.
|
|
39
|
+
- Blur-gated invalid UX and valid messaging both behave correctly.
|
|
40
|
+
- Parent-side error semantics remain explicit and predictable.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Reference: InputCryptoAddress
|
|
2
|
+
|
|
3
|
+
Source of truth:
|
|
4
|
+
- `packages/core/src/components/inputs/InputCryptoAddress/InputCryptoAddress.vue`
|
|
5
|
+
- `packages/core/src/components/inputs/InputCryptoAddress/README.md`
|
|
6
|
+
|
|
7
|
+
## Public Props
|
|
8
|
+
- `value?: string`
|
|
9
|
+
- `placeholder?: string`
|
|
10
|
+
- `state?: "normal" | "active" | "disabled" | "readonly" | "error"`
|
|
11
|
+
- `size?: "compact" | "normal"`
|
|
12
|
+
- `chain: "eth" | "btc" | "sol"` (required)
|
|
13
|
+
- `knownAddresses?: { label: string; address: string }[]`
|
|
14
|
+
- `knownAddressesLabel?: string`
|
|
15
|
+
- `validator?: (value: string) => boolean`
|
|
16
|
+
|
|
17
|
+
## Emitted Events
|
|
18
|
+
- `update:value` -> address string
|
|
19
|
+
|
|
20
|
+
## Validation/Behavior Notes
|
|
21
|
+
- Chain-specific default validators:
|
|
22
|
+
- ETH: `0x` + 40 hex chars
|
|
23
|
+
- BTC: legacy/bech32 pattern
|
|
24
|
+
- SOL: base58 length 32-44
|
|
25
|
+
- Optional `validator` overrides built-ins.
|
|
26
|
+
- Internal invalid UI is blur-gated.
|
|
27
|
+
- Valid status messaging still appears for valid non-empty input.
|
|
28
|
+
- Parent `state="error"` is immediate and should remain authoritative.
|
|
29
|
+
- Known addresses appear via dropdown-style list on focus.
|
|
30
|
+
|
|
31
|
+
## Integration Pitfalls
|
|
32
|
+
- Component trims input on update; preserve this expectation in parent.
|
|
33
|
+
- Known-address selection can blur/close list; avoid extra focus handlers that conflict.
|
|
34
|
+
- If custom validator is chain-specific, keep chain and validator aligned.
|
|
35
|
+
|
|
36
|
+
## Agent Verification Checklist
|
|
37
|
+
- Invalid non-empty value while focused -> no internal invalid state.
|
|
38
|
+
- Blur invalid value -> invalid state/message appears.
|
|
39
|
+
- Valid non-empty value -> valid status appears.
|
|
40
|
+
- Selecting a known address updates bound model and closes list correctly.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Umbra Skill: InputEmail
|
|
2
|
+
|
|
3
|
+
Use this skill for validated email capture with typo suggestions and domain completion.
|
|
4
|
+
|
|
5
|
+
## When To Use
|
|
6
|
+
- You need email-specific validation and normalization.
|
|
7
|
+
- You want domain suggestions and typo correction hints.
|
|
8
|
+
- You need `update:valid` to drive form submission state.
|
|
9
|
+
|
|
10
|
+
## Required Context Checklist
|
|
11
|
+
- Mount location and bound email model.
|
|
12
|
+
- Whether suggestions should be shown.
|
|
13
|
+
- Whether subdomains are allowed.
|
|
14
|
+
- Submit/error behavior based on `update:valid`.
|
|
15
|
+
- Any external/server error flow using `state='error'`.
|
|
16
|
+
|
|
17
|
+
## Ask Developer If Missing
|
|
18
|
+
- "Should domain suggestions be enabled?"
|
|
19
|
+
- "Should subdomain emails be accepted?"
|
|
20
|
+
- "Do we block submit unless `@update:valid` is true?"
|
|
21
|
+
- "Any backend/server email error we should map to `state='error'`?"
|
|
22
|
+
|
|
23
|
+
## Implementation Recipe
|
|
24
|
+
1. Import `InputEmail`.
|
|
25
|
+
2. Bind:
|
|
26
|
+
- `v-model:value="email"`
|
|
27
|
+
- optional `@update:valid="emailValid = $event"`
|
|
28
|
+
- optional `@update:suggestion="..."`
|
|
29
|
+
3. Configure:
|
|
30
|
+
- `:showSuggestions`
|
|
31
|
+
- `:allowSubdomains`
|
|
32
|
+
4. Use `emailValid` in parent submit guards.
|
|
33
|
+
5. Keep parent-driven errors explicit via `state='error'`.
|
|
34
|
+
|
|
35
|
+
## Validation And Edge Cases
|
|
36
|
+
- Internal invalid error appears on blur only (not while focused typing).
|
|
37
|
+
- Error should appear even for malformed non-empty emails on blur.
|
|
38
|
+
- Pasted values should be normalized and validated.
|
|
39
|
+
- Suggestions dropdown keyboard behavior should remain intact.
|
|
40
|
+
|
|
41
|
+
## Definition Of Done
|
|
42
|
+
- Email captures and emits correctly.
|
|
43
|
+
- `update:valid` reflects expected validity.
|
|
44
|
+
- Blur-only internal error behavior works consistently.
|
|
45
|
+
- Suggestion flow works without breaking form interaction.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Umbra Skill: InputNumber
|
|
2
|
+
|
|
3
|
+
Use this skill for numeric fields with optional min/max constraints and unit labels.
|
|
4
|
+
|
|
5
|
+
## When To Use
|
|
6
|
+
- You need numeric-only input with optional range validation.
|
|
7
|
+
- You need min/max messages and optional unit label (`label` prop).
|
|
8
|
+
- You need parent state control with optional business-rule error.
|
|
9
|
+
|
|
10
|
+
## Required Context Checklist
|
|
11
|
+
- Mount location and connected model (`ref<number | undefined>` or `ref<number>`).
|
|
12
|
+
- Min/max range requirements.
|
|
13
|
+
- Whether label/unit is needed.
|
|
14
|
+
- Whether submit should block when value is invalid.
|
|
15
|
+
- Whether parent can override with `state='error'`.
|
|
16
|
+
|
|
17
|
+
## Ask Developer If Missing
|
|
18
|
+
- "What is the accepted numeric range (`min`, `max`)?"
|
|
19
|
+
- "Should empty be allowed or should it coerce to 0?"
|
|
20
|
+
- "Do we need a unit suffix label (%, kg, items)?"
|
|
21
|
+
- "Should the form block submit on invalid range?"
|
|
22
|
+
|
|
23
|
+
## Implementation Recipe
|
|
24
|
+
1. Import `InputNumber`.
|
|
25
|
+
2. Bind `v-model:value` to numeric state.
|
|
26
|
+
3. Pass `:min`, `:max`, and `label` where applicable.
|
|
27
|
+
4. Handle validation outcome in parent as needed (e.g. submit guard).
|
|
28
|
+
5. Keep parent-driven `state='error'` for external/business validation.
|
|
29
|
+
|
|
30
|
+
## Validation And Edge Cases
|
|
31
|
+
- Internal range error appears on blur only (current UX behavior).
|
|
32
|
+
- Error hides during focus/edit.
|
|
33
|
+
- Ensure `undefined`/empty handling is acceptable to parent logic.
|
|
34
|
+
- Ensure negative values work when required.
|
|
35
|
+
|
|
36
|
+
## Definition Of Done
|
|
37
|
+
- Range limits and label render correctly.
|
|
38
|
+
- Blur behavior matches expected UX.
|
|
39
|
+
- Parent logic receives stable numeric values and handles empty state correctly.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Umbra Skill: OTP
|
|
2
|
+
|
|
3
|
+
Use this skill to implement one-time-password code entry with digit cells, keyboard navigation, and completion handling.
|
|
4
|
+
|
|
5
|
+
## When To Use
|
|
6
|
+
- Verification code entry (2FA, email/phone verification, reset flows).
|
|
7
|
+
- Fixed-length numeric code inputs (typically 4/6/8 digits).
|
|
8
|
+
- UX that needs completion callbacks and optional auto-submit.
|
|
9
|
+
|
|
10
|
+
## Required Context Checklist
|
|
11
|
+
- Expected OTP length and whether auto submit is desired.
|
|
12
|
+
- Binding contract (`v-model` string source of truth).
|
|
13
|
+
- Verification trigger (on `complete` vs manual submit button).
|
|
14
|
+
- Loading/error lifecycle from backend verification.
|
|
15
|
+
- Retry/resend behavior and cooldown expectations.
|
|
16
|
+
|
|
17
|
+
## Ask Developer If Missing
|
|
18
|
+
- "How many digits should the OTP require?"
|
|
19
|
+
- "Should verify happen automatically on `complete`, or only after explicit submit?"
|
|
20
|
+
- "What exact error/loading states should appear from backend responses?"
|
|
21
|
+
- "Do we need resend cooldown UI and lockout behavior?"
|
|
22
|
+
|
|
23
|
+
## Implementation Recipe
|
|
24
|
+
1. Import `OTP` from `@umbra.ui/core`.
|
|
25
|
+
2. Create state:
|
|
26
|
+
- `otpCode = ref("")`
|
|
27
|
+
- optional `loading`, `error`, `canSubmit`.
|
|
28
|
+
3. Render:
|
|
29
|
+
- `<OTP v-model="otpCode" :length="..." :auto-submit="..." @complete="..." />`
|
|
30
|
+
4. If manual flow, set `:auto-submit="false"` and verify on button click.
|
|
31
|
+
5. Clear/reset OTP state on failed verification as product requires.
|
|
32
|
+
|
|
33
|
+
## Validation And Edge Cases
|
|
34
|
+
- Ensure only digits are accepted.
|
|
35
|
+
- Paste should distribute digits correctly across cells.
|
|
36
|
+
- Backspace and arrow key navigation should behave naturally.
|
|
37
|
+
- `error` and `loading` props should disable inappropriate interactions.
|
|
38
|
+
- Respect exposed methods (`focus()`, `clear()`) when refs are used.
|
|
39
|
+
|
|
40
|
+
## Definition Of Done
|
|
41
|
+
- OTP input supports expected length and verification flow.
|
|
42
|
+
- Completion and change events wire correctly.
|
|
43
|
+
- Error/loading/retry behavior matches product requirements.
|
|
44
|
+
- Keyboard and paste behavior work in real usage.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Umbra Skill: InputPhone
|
|
2
|
+
|
|
3
|
+
Use this skill when implementing phone-number capture with masking, validation, and formatting events.
|
|
4
|
+
|
|
5
|
+
## When To Use
|
|
6
|
+
- You need phone entry with automatic formatting and validation.
|
|
7
|
+
- You need emitted formatted/valid state for form flow control.
|
|
8
|
+
- You need country-aware behavior (`defaultCountry`, optional international handling).
|
|
9
|
+
|
|
10
|
+
## Required Context Checklist
|
|
11
|
+
- Target file and mount location.
|
|
12
|
+
- Backing model (`ref<string>`) and whether to store raw vs formatted.
|
|
13
|
+
- Required country behavior (`defaultCountry`, `allowInternational`, `showCountryCode`).
|
|
14
|
+
- Validation UX requirements (blur-only internal error is current behavior).
|
|
15
|
+
- Downstream usage of `update:valid`.
|
|
16
|
+
|
|
17
|
+
## Ask Developer If Missing
|
|
18
|
+
- "Should we store/display formatted numbers only, or normalize before submit?"
|
|
19
|
+
- "Which country should be default (`US`, `GB`, etc.)?"
|
|
20
|
+
- "Do we allow international numbers?"
|
|
21
|
+
- "Do you need submit blocking based on `@update:valid`?"
|
|
22
|
+
|
|
23
|
+
## Implementation Recipe
|
|
24
|
+
1. Import `InputPhone` from `@umbra.ui/core`.
|
|
25
|
+
2. Create refs:
|
|
26
|
+
- `phone = ref(\"\")`
|
|
27
|
+
- optional `phoneValid = ref(false)`
|
|
28
|
+
- optional `phoneFormatted = ref(\"\")`
|
|
29
|
+
3. Render:
|
|
30
|
+
- `<InputPhone v-model:value="phone" @update:valid="..." @update:formatted="..." ... />`
|
|
31
|
+
4. Use `phoneValid` for button-disable/submission guard if needed.
|
|
32
|
+
5. Keep parent `state='error'` for server/business errors only.
|
|
33
|
+
|
|
34
|
+
## Validation And Edge Cases
|
|
35
|
+
- Blur-only internal error should appear only after blur when invalid.
|
|
36
|
+
- Error should hide while focused/typing.
|
|
37
|
+
- Max digit constraints should prevent over-input.
|
|
38
|
+
- Paste behavior should sanitize and reformat.
|
|
39
|
+
- Disabled/readonly should remain non-editable.
|
|
40
|
+
|
|
41
|
+
## Definition Of Done
|
|
42
|
+
- Number formats as expected while typing.
|
|
43
|
+
- `update:value`, `update:formatted`, and `update:valid` are consumed correctly.
|
|
44
|
+
- Invalid number shows error on blur, not during active typing.
|
|
45
|
+
- Submit logic honors `phoneValid` where required.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Reference: InputPhone
|
|
2
|
+
|
|
3
|
+
Source of truth:
|
|
4
|
+
- `packages/core/src/components/inputs/InputPhone/InputPhone.vue`
|
|
5
|
+
- `packages/core/src/components/inputs/InputPhone/README.md`
|
|
6
|
+
|
|
7
|
+
## Public Props
|
|
8
|
+
- `value?: string`
|
|
9
|
+
- `placeholder?: string`
|
|
10
|
+
- `defaultCountry?: string` (default `US`)
|
|
11
|
+
- `allowInternational?: boolean` (default `true`)
|
|
12
|
+
- `showCountryCode?: boolean` (default `true`)
|
|
13
|
+
- `state?: "normal" | "active" | "disabled" | "readonly" | "error"`
|
|
14
|
+
|
|
15
|
+
## Emitted Events
|
|
16
|
+
- `update:value` -> formatted phone string
|
|
17
|
+
- `update:formatted` -> formatted phone string
|
|
18
|
+
- `update:valid` -> boolean validity
|
|
19
|
+
|
|
20
|
+
## Validation/Formatting Notes
|
|
21
|
+
- Country detection is heuristic (US/GB/international).
|
|
22
|
+
- Input/paste are digit-sanitized and clamped to country-dependent max digits.
|
|
23
|
+
- Invalid internal state is blur-gated (`hasBlurred` + `!isFocused`).
|
|
24
|
+
- Parent `state="error"` is respected immediately.
|
|
25
|
+
|
|
26
|
+
## Integration Pitfalls
|
|
27
|
+
- Do not assume `update:value` is raw digits; it is formatted.
|
|
28
|
+
- If backend needs normalized digits, normalize in parent before submit.
|
|
29
|
+
- If you implement additional parent validation, avoid fighting internal blur-gated UX.
|
|
30
|
+
|
|
31
|
+
## Agent Verification Checklist
|
|
32
|
+
- Type invalid number while focused -> no internal error shown.
|
|
33
|
+
- Blur invalid number -> error icon/message shown.
|
|
34
|
+
- Focus again and edit -> internal error hidden while editing.
|
|
35
|
+
- `state="error"` from parent shows immediately regardless of focus.
|