Skip to content

Commit

Permalink
refactor: remove unnecessary ids
Browse files Browse the repository at this point in the history
  • Loading branch information
janivo committed Aug 18, 2022
1 parent 1242222 commit 1834743
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import {
} from '@stencil/core';
import classNames from 'classnames';

import { generateUniqueId } from '../../util/component-utils';

/**
* @slot default - Label of the button
*/
Expand All @@ -22,7 +20,7 @@ import { generateUniqueId } from '../../util/component-utils';
shadow: true,
})
export class InoSegmentButton implements ComponentInterface {
private buttonId = `ino-segment-button-id_${generateUniqueId()}`;

private successor: Element;
private belongsToGroup = false;

Expand Down Expand Up @@ -134,7 +132,6 @@ export class InoSegmentButton implements ComponentInterface {
<button
class={buttonClasses}
disabled={this.disabled}
id={this.buttonId}
name={this.name}
>
<div class="mdc-button__label">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
import {
Component,
ComponentInterface,
Element,
Host,
Prop,
Watch,
h,
} from '@stencil/core';

import { generateUniqueId } from '../../util/component-utils';
import {Component, ComponentInterface, Element, h, Host, Prop, Watch,} from '@stencil/core';

/**
* @slot default - One or more `ino-segment-button`
Expand All @@ -19,7 +9,6 @@ import { generateUniqueId } from '../../util/component-utils';
shadow: true,
})
export class InoSegmentGroup implements ComponentInterface {
private groupId = `ino-segment-group-id_${generateUniqueId()}`;

@Element() el: HTMLInoSegmentGroupElement;

Expand Down Expand Up @@ -63,7 +52,7 @@ export class InoSegmentGroup implements ComponentInterface {

render() {
return (
<Host id={this.groupId} name={this.name} value={this.value}>
<Host name={this.name} value={this.value}>
<slot></slot>
</Host>
);
Expand Down
4 changes: 1 addition & 3 deletions packages/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@
"dev": "start-storybook -p 6006 -c config --quiet --no-version-updates",
"build": "build-storybook -c config -o dist",
"test": "concurrently --names \"SB,TEST\" -c \"magenta,blue\" --success \"command-TEST\" --kill-others \"http-server ./dist --port 8008 --silent\" \"wait-on tcp:8008 && yarn test-storybook --config-dir config --url http://localhost:8008 \"",
"test:update-ci": "concurrently --names \"SB,TEST\" -c \"magenta,blue\" --success \"command-TEST\" --kill-others \"http-server ./dist --port 8008 --silent\" \"wait-on tcp:8008 && yarn test-storybook --updateSnapshot --config-dir config --url http://localhost:8008 \"",
"test:watch": "test-storybook --watch --config-dir config",
"test:update": "test-storybook --config-dir config --updateSnapshot",
"test:update": "concurrently --names \"SB,TEST\" -c \"magenta,blue\" --success \"command-TEST\" --kill-others \"http-server ./dist --port 8008 --silent\" \"wait-on tcp:8008 && yarn test-storybook --updateSnapshot --config-dir config --url http://localhost:8008 \"",
"lint": "eslint src",
"lint:fix": "eslint src --fix"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ exports[`Structure/<ino-card> DisabledElevation smoke-test 1`] = `
<div slot="footer"
class="sample-card-footer"
>
<ino-segment-group id="ino-segment-group-id__1jmgs2d08"
<ino-segment-group id="ino-segment-group-id__cg0cfpq5y"
class="hydrated"
>
<ino-segment-button value="1"
Expand Down Expand Up @@ -114,7 +114,7 @@ exports[`Structure/<ino-card> Playground smoke-test 1`] = `
<div slot="footer"
class="sample-card-footer"
>
<ino-segment-group id="ino-segment-group-id__18tz4tu3q"
<ino-segment-group id="ino-segment-group-id__za0fcf6ur"
class="hydrated"
>
<ino-segment-button value="1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ exports[`Structure/<ino-dialog> ClosingAction smoke-test 1`] = `
</div>
<div class="ino-dialog-content">
<ino-segment-group value="2"
id="ino-segment-group-id__0nwa273so"
id="ino-segment-group-id__zx17mkqhh"
class="hydrated"
>
<ino-segment-button dense
Expand Down Expand Up @@ -167,7 +167,7 @@ exports[`Structure/<ino-dialog> Dismissible smoke-test 1`] = `
</div>
<div class="ino-dialog-content">
<ino-segment-group value="2"
id="ino-segment-group-id__u06p39bdh"
id="ino-segment-group-id__5rilgf6qq"
class="hydrated"
>
<ino-segment-button dense
Expand Down Expand Up @@ -288,7 +288,7 @@ exports[`Structure/<ino-dialog> FullWidth smoke-test 1`] = `
</div>
<div class="ino-dialog-content">
<ino-segment-group value="2"
id="ino-segment-group-id__wjct1ttog"
id="ino-segment-group-id__andzoe05m"
class="hydrated"
>
<ino-segment-button dense
Expand Down Expand Up @@ -409,7 +409,7 @@ exports[`Structure/<ino-dialog> Playground smoke-test 1`] = `
</div>
<div class="ino-dialog-content">
<ino-segment-group value="2"
id="ino-segment-group-id__fjn79z8qx"
id="ino-segment-group-id__nka4kq0sx"
class="hydrated"
>
<ino-segment-button dense
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ exports[`Structure/ino-menu Playground smoke-test 1`] = `
Open Menu
</p>
<ino-icon-button icon="menu"
id="elements-menu_8jczioa9z"
id="elements-menu_g8u83le7a"
class="ino-icon-button--color-scheme-primary hydrated"
aria-expanded="false"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`Buttons/ino-segment-group Playground smoke-test 1`] = `
<div id="root-inner">
<div class="story-segment-group">
<ino-segment-group id="ino-segment-group-id__qz6l81dsn"
<ino-segment-group id="ino-segment-group-id__2s0h4k9dy"
name
value="opt-2"
class="hydrated"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports[`Input/ino-switch Checked smoke-test 1`] = `
name
class="ino-switch ino-switch--color-scheme-primary hydrated"
>
<button id="ino-switch-id__5ao13o3rl"
<button id="ino-switch-id__xxacca8jd"
class="mdc-switch mdc-switch--selected mdc-ripple-upgraded mdc-ripple-upgraded--unbounded"
type="button"
role="switch"
Expand All @@ -25,7 +25,7 @@ exports[`Input/ino-switch Checked smoke-test 1`] = `
</div>
</div>
</button>
<label for="ino-switch-id__5ao13o3rl">
<label for="ino-switch-id__xxacca8jd">
Switch Label
<input type="hidden"
class="aux-input"
Expand All @@ -47,7 +47,7 @@ exports[`Input/ino-switch Disabled smoke-test 1`] = `
name
class="ino-switch ino-switch--color-scheme-primary ino-switch-disabled hydrated"
>
<button id="ino-switch-id__10bm7wkda"
<button id="ino-switch-id__l6v1laoft"
class="mdc-switch mdc-switch--unselected mdc-ripple-upgraded mdc-ripple-upgraded--unbounded"
disabled
type="button"
Expand All @@ -64,7 +64,7 @@ exports[`Input/ino-switch Disabled smoke-test 1`] = `
</div>
</div>
</button>
<label for="ino-switch-id__10bm7wkda">
<label for="ino-switch-id__l6v1laoft">
Switch Label
<input type="hidden"
class="aux-input"
Expand All @@ -87,7 +87,7 @@ exports[`Input/ino-switch Playground smoke-test 1`] = `
name
class="ino-switch ino-switch--color-scheme-primary hydrated"
>
<button id="ino-switch-id__ibqqacosg"
<button id="ino-switch-id__4h67rw409"
class="mdc-switch mdc-switch--unselected mdc-ripple-upgraded mdc-ripple-upgraded--unbounded"
type="button"
role="switch"
Expand All @@ -103,7 +103,7 @@ exports[`Input/ino-switch Playground smoke-test 1`] = `
</div>
</div>
</button>
<label for="ino-switch-id__ibqqacosg">
<label for="ino-switch-id__4h67rw409">
Switch Label
<input type="hidden"
class="aux-input"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ exports[`Structure/ino-table-header-cell Label smoke-test 1`] = `
label="Search for XY..."
role="columnheader"
class="mdc-data-table__header-cell ino-table-header-cell--searchable ino-table-header-cell--sortable hydrated"
data-column-id="_ut04tz6xh"
data-column-id="_70pvp2ne8"
tabindex="-1"
id="ino-table-header-cell-id__rb3v5mwh3"
id="ino-table-header-cell-id__45fxikxxb"
style="max-width: 230px;"
>
<ino-popover color-scheme="transparent"
Expand Down Expand Up @@ -81,9 +81,9 @@ exports[`Structure/ino-table-header-cell NotSortable smoke-test 1`] = `
label="Label"
role="columnheader"
class="mdc-data-table__header-cell ino-table-header-cell--searchable hydrated"
data-column-id="_2ss8tt5u9"
data-column-id="_ljm9iawco"
tabindex="-1"
id="ino-table-header-cell-id__j3bzbvybm"
id="ino-table-header-cell-id__n7xtda7pr"
style="max-width: 230px;"
>
<ino-popover color-scheme="transparent"
Expand Down Expand Up @@ -133,9 +133,9 @@ exports[`Structure/ino-table-header-cell Playground smoke-test 1`] = `
label="Label"
role="columnheader"
class="mdc-data-table__header-cell ino-table-header-cell--searchable ino-table-header-cell--sortable hydrated"
data-column-id="_rfg69s4l9"
data-column-id="_de5mdkmmj"
tabindex="-1"
id="ino-table-header-cell-id__lumbdrmr7"
id="ino-table-header-cell-id__3km4a4cbk"
style="max-width: 230px;"
>
<ino-popover color-scheme="transparent"
Expand Down Expand Up @@ -198,9 +198,9 @@ exports[`Structure/ino-table-header-cell SearchIcon smoke-test 1`] = `
label="Label"
role="columnheader"
class="mdc-data-table__header-cell ino-table-header-cell--searchable ino-table-header-cell--sortable hydrated"
data-column-id="_b2whze15c"
data-column-id="_d4xwnpm77"
tabindex="-1"
id="ino-table-header-cell-id__5jm24b2z6"
id="ino-table-header-cell-id__hwtllvj4l"
style="max-width: 230px;"
>
<ino-popover color-scheme="transparent"
Expand Down Expand Up @@ -259,9 +259,9 @@ exports[`Structure/ino-table-header-cell SearchWithDatepicker smoke-test 1`] = `
search-icon="calendar"
class="datepicker-cell mdc-data-table__header-cell ino-table-header-cell--searchable ino-table-header-cell--sortable hydrated"
role="columnheader"
data-column-id="_4e417qp6i"
data-column-id="_cevbyemt6"
tabindex="-1"
id="ino-table-header-cell-id__imi9r6404"
id="ino-table-header-cell-id__n209th53j"
style="max-width: 230px;"
>
<ino-popover color-scheme="transparent"
Expand Down Expand Up @@ -320,9 +320,9 @@ exports[`Structure/ino-table-header-cell SearchWithSelection smoke-test 1`] = `
search-icon="filter"
role="columnheader"
class="mdc-data-table__header-cell ino-table-header-cell--searchable ino-table-header-cell--sortable hydrated"
data-column-id="_o2fkls9en"
data-column-id="_qf4c0fmui"
tabindex="-1"
id="ino-table-header-cell-id__4eqklchw8"
id="ino-table-header-cell-id__m2k26k36n"
style="max-width: 230px;"
>
<ino-popover color-scheme="transparent"
Expand Down Expand Up @@ -385,9 +385,9 @@ exports[`Structure/ino-table-header-cell Searched smoke-test 1`] = `
label="Label"
role="columnheader"
class="mdc-data-table__header-cell ino-table-header-cell--searchable ino-table-header-cell--sortable ino-table-header-cell--searched hydrated"
data-column-id="_wgte02g8e"
data-column-id="_7zufs1zsk"
tabindex="-1"
id="ino-table-header-cell-id__5609jw0sq"
id="ino-table-header-cell-id__9xz9y4hhr"
style="max-width: 230px;"
>
<ino-popover color-scheme="transparent"
Expand Down Expand Up @@ -450,9 +450,9 @@ exports[`Structure/ino-table-header-cell SortDirection smoke-test 1`] = `
label="Label"
role="columnheader"
class="mdc-data-table__header-cell ino-table-header-cell--searchable ino-table-header-cell--sortable hydrated"
data-column-id="_4b10wdac1"
data-column-id="_xn1wzz0cq"
tabindex="-1"
id="ino-table-header-cell-id__pr83abnp5"
id="ino-table-header-cell-id__1cuomzcax"
style="max-width: 230px;"
>
<ino-popover color-scheme="transparent"
Expand Down
Loading

0 comments on commit 1834743

Please sign in to comment.