Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: SelectableTileGroup #439

Open
wants to merge 57 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
9af756b
Add padding prop to Grid component
ispyinternet Nov 27, 2020
06ecbe7
Fix file name
ispyinternet Nov 27, 2020
585341d
Build lib
ispyinternet Nov 27, 2020
47f6292
Merge master
ispyinternet Nov 27, 2020
f17b35d
Typo
ispyinternet Nov 27, 2020
3c59a6c
Move DataTableSkelton 3119restProps to container
ispyinternet Nov 27, 2020
36987b2
Merge branch 'master' of github.com:IBM/carbon-components-svelte
ispyinternet Nov 27, 2020
626fd99
Merge branch 'master' of github.com:IBM/carbon-components-svelte
ispyinternet Nov 30, 2020
fe5c571
WIP: SelectableTileGroup
ispyinternet Nov 30, 2020
184c3d9
Some fixes
ispyinternet Nov 30, 2020
5f5293a
Some fixes
ispyinternet Nov 30, 2020
94f5965
Some fixes
ispyinternet Nov 30, 2020
d874180
Some fixes
ispyinternet Nov 30, 2020
a249b61
Some fixes
ispyinternet Nov 30, 2020
b5ec601
Some fixes
ispyinternet Nov 30, 2020
060b53b
Some fixes
ispyinternet Nov 30, 2020
1d1fe47
Some fixes
ispyinternet Nov 30, 2020
98cee82
Some fixes
ispyinternet Nov 30, 2020
4c3ea78
Some fixes
ispyinternet Nov 30, 2020
5b9bc98
Some fixes
ispyinternet Nov 30, 2020
5ef181d
Remove light prop from SelectableTileGroup
ispyinternet Nov 30, 2020
746ce92
implement change requests
ispyinternet Dec 1, 2020
10da838
add build
ispyinternet Dec 1, 2020
480337f
implement change requests
ispyinternet Dec 1, 2020
c37d7b3
Strip out RadioTileGroup
ispyinternet Dec 1, 2020
b83d6ad
update fix required for both branches of the if statement! - may as w…
ispyinternet Dec 1, 2020
ed9d109
Fix failing RadioTile test
ispyinternet Dec 1, 2020
80f49f6
Prepare for pull request
ispyinternet Dec 1, 2020
4665e28
chore: delete RadioTileGroup.d.ts
metonym Dec 1, 2020
de1c2d0
Fix binding bug
ispyinternet Dec 1, 2020
17a77b6
Merge remote-tracking branch 'origin/master'
ispyinternet Dec 1, 2020
ce8e0b2
Merge remote-tracking branch 'ispyinternet/master'
ispyinternet Dec 1, 2020
ef76f2c
Revert RadioTile tabindex
ispyinternet Dec 1, 2020
9db8f9d
Support fieldset disabled
ispyinternet Dec 1, 2020
95bfb72
Support fieldset disabled
ispyinternet Dec 1, 2020
21f75af
Merge branch 'master' of github.com:ispyinternet/carbon-components-sv…
ispyinternet Dec 1, 2020
5a11a49
Move tabindex to input element
ispyinternet Dec 1, 2020
b380393
docs(selectable-tile): add use cases
metonym Dec 6, 2020
03b7be1
chore: reset selected value in controlled example
metonym Dec 6, 2020
5a4328e
try to fix reactivity
ispyinternet Dec 10, 2020
70d50f7
try to fix reactivity
ispyinternet Dec 10, 2020
677f6b5
try to fix reactivity
ispyinternet Dec 10, 2020
37dd97e
try to fix reactivity
ispyinternet Dec 10, 2020
fe84e9a
try to fix reactivity
ispyinternet Dec 10, 2020
3b1efdd
try to fix reactivity
ispyinternet Dec 10, 2020
b5d641d
try to fix reactivity
ispyinternet Dec 10, 2020
4d82e78
try to fix reactivity
ispyinternet Dec 10, 2020
1c0f7e7
try to fix reactivity
ispyinternet Dec 10, 2020
7cd0df9
try to fix reactivity
ispyinternet Dec 10, 2020
52240c6
try to fix reactivity
ispyinternet Dec 10, 2020
e6fdda5
try to fix reactivity
ispyinternet Dec 10, 2020
8431b58
try to fix reactivity
ispyinternet Dec 10, 2020
172f54e
try to fix reactivity
ispyinternet Dec 10, 2020
7b3144f
try to fix reactivity
ispyinternet Dec 10, 2020
ac99f8f
try to fix reactivity
ispyinternet Dec 10, 2020
cbdf10d
try to fix reactivity
ispyinternet Dec 10, 2020
7373aa3
try to fix reactivity
ispyinternet Dec 10, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 59 additions & 10 deletions COMPONENT_INDEX.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Component Index

> 155 components exported from [email protected].
> 157 components exported from [email protected].

## Components

Expand Down Expand Up @@ -97,6 +97,7 @@
- [`RadioButtonGroup`](#radiobuttongroup)
- [`RadioButtonSkeleton`](#radiobuttonskeleton)
- [`RadioTile`](#radiotile)
- [`RadioTileGroup`](#radiotilegroup)
- [`Row`](#row)
- [`Search`](#search)
- [`SearchSkeleton`](#searchskeleton)
Expand All @@ -105,6 +106,7 @@
- [`SelectItemGroup`](#selectitemgroup)
- [`SelectSkeleton`](#selectskeleton)
- [`SelectableTile`](#selectabletile)
- [`SelectableTileGroup`](#selectabletilegroup)
- [`SideNav`](#sidenav)
- [`SideNavItems`](#sidenavitems)
- [`SideNavLink`](#sidenavlink)
Expand Down Expand Up @@ -2692,15 +2694,17 @@ None.

### Props

| Prop name | Kind | Reactive | Type | Default value | Description |
| :-------------- | :--------------- | :------- | :------------------- | ------------------------------------------------ | -------------------------------------------------------- |
| checked | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to check the tile |
| light | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to enable the light variant |
| value | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the value of the radio input |
| tabindex | <code>let</code> | No | <code>string</code> | <code>"0"</code> | Specify the tabindex |
| iconDescription | <code>let</code> | No | <code>string</code> | <code>"Tile checkmark"</code> | Specify the ARIA label for the radio tile checkmark icon |
| id | <code>let</code> | No | <code>string</code> | <code>"ccs-" + Math.random().toString(36)</code> | Set an id for the input element |
| name | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify a name attribute for the input |
| Prop name | Kind | Reactive | Type | Default value | Description |
| :-------------- | :--------------- | :------- | :---------------------------------------- | ------------------------------------------------ | -------------------------------------------------------- |
| ref | <code>let</code> | Yes | <code>null &#124; HTMLInputElement</code> | <code>null</code> | Obtain a reference to the input HTML element |
| checked | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to check the tile |
| light | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to enable the light variant |
| value | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the value of the radio input |
| title | <code>let</code> | No | <code>string</code> | <code>"title"</code> | Specify the title of the selectable tile |
| tabindex | <code>let</code> | No | <code>string</code> | <code>"0"</code> | Specify the tabindex |
| iconDescription | <code>let</code> | No | <code>string</code> | <code>"Tile checkmark"</code> | Specify the ARIA label for the radio tile checkmark icon |
| id | <code>let</code> | No | <code>string</code> | <code>"ccs-" + Math.random().toString(36)</code> | Set an id for the input element |
| name | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify a name attribute for the input |

### Slots

Expand All @@ -2719,6 +2723,28 @@ None.
| mouseenter | forwarded | -- |
| mouseleave | forwarded | -- |

## `RadioTileGroup`

### Props

| Prop name | Kind | Reactive | Type | Default value | Description |
| :------------ | :--------------- | :------- | :------------------- | ------------------ | --------------------------------------- |
| selectedValue | <code>let</code> | Yes | <code>string</code> | -- | Specify the selected tile value |
| disabled | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to disable the tile group |
| legend | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the legend text |

### Slots

| Slot name | Default | Props | Fallback |
| :-------- | :------ | :---- | :------- |
| -- | Yes | -- | -- |

### Events

| Event name | Type | Detail |
| :--------- | :--------- | :----- |
| select | dispatched | -- |

## `Row`

### Props
Expand Down Expand Up @@ -2929,6 +2955,29 @@ None.
| mouseleave | forwarded | -- |
| keydown | forwarded | -- |

## `SelectableTileGroup`

### Props

| Prop name | Kind | Reactive | Type | Default value | Description |
| :------------- | :--------------- | :------- | :------------------- | ------------------ | ----------------------------------------- |
| selectedValues | <code>let</code> | Yes | <code>string</code> | <code>[]</code> | Specify the selected tile's |
| disabled | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to disable the tile group |
| light | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to enable the light variant |
| legend | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the legend text |

### Slots

| Slot name | Default | Props | Fallback |
| :-------- | :------ | :---- | :------- |
| -- | Yes | -- | -- |

### Events

| Event name | Type | Detail |
| :--------- | :--------- | :----- |
| select | dispatched | -- |

## `SideNav`

### Props
Expand Down
111 changes: 110 additions & 1 deletion docs/src/COMPONENT_API.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"total": 155,
"total": 157,
"components": [
{
"moduleName": "SkeletonText",
Expand Down Expand Up @@ -8652,6 +8652,16 @@
"constant": false,
"reactive": false
},
{
"name": "title",
"kind": "let",
"description": "Specify the title of the selectable tile",
"type": "string",
"value": "\"title\"",
"isFunction": false,
"constant": false,
"reactive": false
},
{
"name": "tabindex",
"kind": "let",
Expand Down Expand Up @@ -8691,6 +8701,16 @@
"isFunction": false,
"constant": false,
"reactive": false
},
{
"name": "ref",
"kind": "let",
"description": "Obtain a reference to the input HTML element",
"type": "null | HTMLInputElement",
"value": "null",
"isFunction": false,
"constant": false,
"reactive": true
}
],
"slots": [{ "name": "__default__", "default": true, "slot_props": "{}" }],
Expand Down Expand Up @@ -8744,6 +8764,95 @@
"typedefs": [],
"rest_props": { "type": "Element", "name": "fieldset" }
},
{
"moduleName": "RadioTileGroup",
"filePath": "/src/Tile/RadioTileGroup.svelte",
"props": [
{
"name": "selectedValue",
"kind": "let",
"description": "Specify the selected tile value",
"type": "string",
"isFunction": false,
"constant": false,
"reactive": true
},
{
"name": "disabled",
"kind": "let",
"description": "Set to `true` to disable the tile group",
"type": "boolean",
"value": "false",
"isFunction": false,
"constant": false,
"reactive": false
},
{
"name": "legend",
"kind": "let",
"description": "Specify the legend text",
"type": "string",
"value": "\"\"",
"isFunction": false,
"constant": false,
"reactive": false
}
],
"slots": [{ "name": "__default__", "default": true, "slot_props": "{}" }],
"events": [{ "type": "dispatched", "name": "select" }],
"typedefs": [],
"rest_props": { "type": "Element", "name": "fieldset" }
},
{
"moduleName": "SelectableTileGroup",
"filePath": "/src/Tile/SelectableTileGroup.svelte",
"props": [
{
"name": "selectedValues",
"kind": "let",
"description": "Specify the selected tile's",
"type": "string",
"value": "[]",
"isFunction": false,
"constant": false,
"reactive": true
},
{
"name": "disabled",
"kind": "let",
"description": "Set to `true` to disable the tile group",
"type": "boolean",
"value": "false",
"isFunction": false,
"constant": false,
"reactive": false
},
{
"name": "light",
"kind": "let",
"description": "Set to `true` to enable the light variant",
"type": "boolean",
"value": "false",
"isFunction": false,
"constant": false,
"reactive": false
},
{
"name": "legend",
"kind": "let",
"description": "Specify the legend text",
"type": "string",
"value": "\"\"",
"isFunction": false,
"constant": false,
"reactive": false
}
],
"slots": [{ "name": "__default__", "default": true, "slot_props": "{}" }],
"events": [{ "type": "dispatched", "name": "select" }],
"typedefs": [],
"rest_props": { "type": "Element", "name": "fieldset" }
},
{
"moduleName": "TimePicker",
"filePath": "/src/TimePicker/TimePicker.svelte",
Expand Down
24 changes: 15 additions & 9 deletions docs/src/pages/components/RadioTile.svx
Original file line number Diff line number Diff line change
@@ -1,36 +1,42 @@
---
components: ["TileGroup", "RadioTile"]
components: ["RadioTileGroup", "RadioTile"]
---

<script>
import { TileGroup, RadioTile } from "carbon-components-svelte";
import { RadioTileGroup, RadioTile, InlineNotification } from "carbon-components-svelte";
import Preview from "../../components/Preview.svelte";
</script>

<InlineNotification svx-ignore title="Deprecation warning:" kind="warning" hideCloseButton>
<div>
The TileGroup component will be removed in favour of the RadioTileGroup component in the next major release.
</div>
</InlineNotification>

### Default

<TileGroup legend="Service pricing tiers">
<RadioTileGroup legend="Service pricing tiers">
<RadioTile value="0" checked>
Lite plan
</RadioTile>
<RadioTile value="1">
Standard plan
</RadioTile>
<RadioTile value="2">
Plus plan
<RadioTile light value="2">
Plus plan (light variant)
</RadioTile>
</TileGroup>

### Light variant

<TileGroup legend="Service pricing tiers">
<RadioTile value="0" checked>
<RadioTileGroup legend="Service pricing tiers">
<RadioTile light value="0" checked>
Lite plan
</RadioTile>
<RadioTile value="1">
<RadioTile light value="1">
Standard plan
</RadioTile>
<RadioTile value="2">
<RadioTile light value="2">
Plus plan
</RadioTile>
</TileGroup>
42 changes: 24 additions & 18 deletions docs/src/pages/components/SelectableTile.svx
Original file line number Diff line number Diff line change
@@ -1,36 +1,42 @@
---
components: ["SelectableTile"]
components: ["SelectableTile", "SelectableTileGroup"]
---

<script>
import { SelectableTile } from "carbon-components-svelte";
import { SelectableTile, SelectableTileGroup } from "carbon-components-svelte";
import Preview from "../../components/Preview.svelte";
</script>

### Multi-selectable tiles

<div role="group" aria-label="selectable tiles">
<SelectableTile selected>
Multi-select Tile
<SelectableTileGroup legend="Select the options you require">
<SelectableTile title="Option 1" selected>
Option 1
</SelectableTile>
<SelectableTile selected>
Multi-select Tile
<SelectableTile title="Option 2" selected>
Option 2
</SelectableTile>
<SelectableTile>
Multi-select Tile
<SelectableTile title="Option 3">
Option 3
</SelectableTile>
<SelectableTile light title="Option 4">
Option 4 (light variant)
</SelectableTile>
</div>

### Light variant
### Multi-selectable tiles with light variant

<div role="group" aria-label="selectable tiles">
<SelectableTile light selected>
Multi-select Tile
<SelectableTileGroup legend="Select the options you require">
<SelectableTile light title="Option 1" selected>
Option 1
</SelectableTile>
<SelectableTile light title="Option 2" selected>
Option 2
</SelectableTile>
<SelectableTile light selected>
Multi-select Tile
<SelectableTile light title="Option 3">
Option 3
</SelectableTile>
<SelectableTile light>
Multi-select Tile
<SelectableTile light title="Option 4">
Option 4
</SelectableTile>
</div>
</div>
3 changes: 2 additions & 1 deletion src/DataTableSkeleton/DataTableSkeleton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,18 @@
</section>
{/if}
<table
{...$$restProps}
class:bx--skeleton="{true}"
class:bx--data-table="{true}"
class:bx--data-table--compact="{size === 'compact'}"
class:bx--data-table--short="{size === 'short'}"
class:bx--data-table--tall="{size === 'tall'}"
class:bx--data-table--zebra="{zebra}"
{...$$restProps}
on:click
on:mouseover
on:mouseenter
on:mouseleave
{...$$restProps}
>
<thead>
<tr>
Expand Down
Loading