Skip to content

Commit

Permalink
🚧 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
acidjazz committed Jun 21, 2023
1 parent 11b0515 commit 5f47048
Show file tree
Hide file tree
Showing 24 changed files with 612 additions and 53 deletions.
4 changes: 3 additions & 1 deletion docs/components/content/ComponentCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
v-if="prop.type === 'boolean'"
v-model="componentProps[prop.name]"
:name="`prop-${prop.name}`"
variant="none"
tabindex="-1"
:ui="{ wrapper: 'relative flex items-start justify-center' }"
/>
<USelectMenu
Expand All @@ -18,6 +18,7 @@
variant="none"
:ui="{ width: 'w-32 !-mt-px', rounded: 'rounded-b-md', wrapper: 'relative inline-flex' }"
class="!py-0"
tabindex="-1"
:popper="{ strategy: 'fixed', placement: 'bottom-start' }"
/>
<UInput
Expand All @@ -28,6 +29,7 @@
variant="none"
autocomplete="off"
class="!py-0"
tabindex="-1"
@update:model-value="val => componentProps[prop.name] = prop.type === 'number' ? Number(val) : val"
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/content/examples/CheckboxExample.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
const selected = ref(false)
const selected = ref(true)
</script>

<template>
Expand Down
7 changes: 7 additions & 0 deletions docs/components/content/examples/RangeExample.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<script setup>
const value = ref(50)
</script>

<template>
<URange v-model="value" />
</template>
2 changes: 1 addition & 1 deletion docs/content/1.getting-started/3.theming.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Likewise, you can't define a `primary` color in your `tailwind.config.ts` as it
We'd advise you to use those colors in your components and pages, e.g. `text-primary-500 dark:text-primary-400`, `bg-gray-100 dark:bg-gray-900`, etc. so your app automatically adapts when changing your `app.config.ts`.
::

Components having a `color` prop like [Avatar](/elements/avatar#chip), [Badge](/elements/badge#style), [Button](/elements/button#style), [Input](/elements/input#style) (inherited in [Select](/forms/select) and [SelectMenu](/forms/select-menu)) and [Notification](/overlays/notification#timeout) will use the `primary` color by default but will handle all the colors defined in your `tailwind.config.ts` or the default Tailwind CSS colors.
Components having a `color` prop like [Avatar](/elements/avatar#chip), [Badge](/elements/badge#style), [Button](/elements/button#style), [Input](/elements/input#style) (inherited in [Select](/forms/select) and [SelectMenu](/forms/select-menu)), [Radio](/forms/radio), [Checkbox](/forms/checkbox), [Toggle](/forms/toggle), [Range](/forms/range) and [Notification](/overlays/notification#timeout) will use the `primary` color by default but will handle all the colors defined in your `tailwind.config.ts` or the default Tailwind CSS colors.

Variant classes of those components are defined with a syntax like `bg-{color}-500 dark:bg-{color}-400` so they can be used with any color. However, this means that Tailwind will not find those classes and therefore will not generate the corresponding CSS.

Expand Down
20 changes: 17 additions & 3 deletions docs/content/3.forms/5.checkbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Use a `v-model` to make the Checkbox reactive.
#code
```vue
<script setup>
const selected = ref(false)
const selected = ref(true)
</script>
<template>
Expand All @@ -36,14 +36,28 @@ props:
---
::

### Style

Use the `color` prop to change the style of the Checkbox.

::component-card
---
baseProps:
name: 'checkbox2'
label: 'Label'
props:
color: 'primary'
---
::

### Required

Use the `required` prop to display a red star next to the label.

::component-card
---
baseProps:
name: 'checkbox2'
name: 'checkbox3'
props:
label: 'Label'
required: true
Expand All @@ -57,7 +71,7 @@ Use the `help` prop to display some text under the Checkbox.
::component-card
---
baseProps:
name: 'checkbox3'
name: 'checkbox4'
props:
label: 'Label'
help: 'Please check this box'
Expand Down
20 changes: 17 additions & 3 deletions docs/content/3.forms/6.radio.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,28 @@ props:
---
::

### Style

Use the `color` prop to change the style of the Radio.

::component-card
---
baseProps:
name: 'radio2'
label: 'Label'
props:
color: 'primary'
---
::

### Required

Use the `required` prop to display a red star next to the label.

::component-card
---
baseProps:
name: 'radio2'
name: 'radio3'
props:
label: 'Label'
required: true
Expand All @@ -71,7 +85,7 @@ Use the `help` prop to display some text under the Radio.
::component-card
---
baseProps:
name: 'radio3'
name: 'radio4'
props:
label: 'Label'
help: 'Please choose one'
Expand All @@ -85,7 +99,7 @@ Use the `disabled` prop to disable the Radio.
::component-card
---
baseProps:
name: 'radio4'
name: 'radio5'
value: true
props:
disabled: true
Expand Down
11 changes: 11 additions & 0 deletions docs/content/3.forms/7.toggle.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ const selected = ref(false)
```
::

### Style

Use the `color` prop to change the style of the Toggle.

::component-card
---
props:
color: 'primary'
---
::

### Icon

Use any icon from [Iconify](https://icones.js.org) by setting the `on-icon` and `off-icon` props by using this pattern: `i-{collection_name}-{icon_name}` or change it globally in `ui.toggle.default.onIcon` and `ui.toggle.default.offIcon`.
Expand Down
101 changes: 101 additions & 0 deletions docs/content/3.forms/8.range.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
---
github: true
description: Display a range field
navigation:
badge: "Edge"
---

## Usage

Use a `v-model` to make the Range reactive.

::component-example
#default
:range-example

#code
```vue
<script setup>
const value = ref(50)
</script>
<template>
<URange v-model="value" />
</template>
```
::

### Style

Use the `color` prop to change the visual style of the Range.

::component-card
---
baseProps:
name: range'
placeholder: 'Search...'
props:
color: 'primary'
---
::

### Size

Use the `size` prop to change the size of the Range.

::component-card
---
baseProps:
name: 'range'
props:
size: 'md'
---
::

### Disabled

Use the `disabled` prop to disable the Range.

::component-card
---
baseProps:
name: 'range'
props:
disabled: true
---
::

### Min and Max

Use the `min` and `max` prop to configure the Range.

::component-card
---
baseProps:
name: 'range'
props:
min: 0
max: 100
---
::

### Step

Use the `step` prop to change the step increment.

::component-card
---
baseProps:
name: 'range'
props:
step: 20
---
::

## Props

:component-props

## Preset

:component-preset
Loading

0 comments on commit 5f47048

Please sign in to comment.