Skip to content

Commit

Permalink
Merge branch 'feature/loading-skeleton-demo' into feat/etch-371-loadi…
Browse files Browse the repository at this point in the history
…ng-skeleton
  • Loading branch information
Carl-J-M committed Apr 12, 2024
2 parents 062082c + db9722b commit 0277c3e
Show file tree
Hide file tree
Showing 25 changed files with 317 additions and 26 deletions.
1 change: 1 addition & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const config: StorybookConfig = {
'../components/**/*.mdx',
'../components/**/*.stories.@(js|jsx|mjs|ts|tsx)',
'../docs/**/*.mdx',
'../docs/**/*.stories.@(js|jsx|mjs|ts|tsx)',
],
addons: [
'@storybook/addon-links',
Expand Down
49 changes: 49 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,52 @@
## [1.29.1](https://github.com/etchteam/diamond-ui/compare/v1.29.0...v1.29.1) (2024-04-11)


### Bug Fixes

* ios input zoom ([63220d3](https://github.com/etchteam/diamond-ui/commit/63220d31c4329e3f7b19a5213504e4ea2fc95750))

## [1.29.0](https://github.com/etchteam/diamond-ui/compare/v1.28.1...v1.29.0) (2024-03-20)


### Features

* halve input with icon padding ([5f06d4a](https://github.com/etchteam/diamond-ui/commit/5f06d4a57208f4be1ecdd0b88af34f707b7812c6))

## [1.28.1](https://github.com/etchteam/diamond-ui/compare/v1.28.0...v1.28.1) (2024-03-20)


### Bug Fixes

* omit size prop from jsx element ([acb303f](https://github.com/etchteam/diamond-ui/commit/acb303f61ccf46cc8369b05fbf9f148576cb2a15))

## [1.28.0](https://github.com/etchteam/diamond-ui/compare/v1.27.11...v1.28.0) (2024-03-20)


### Features

* indent bullets ([4663c4f](https://github.com/etchteam/diamond-ui/commit/4663c4ffe9ecf0f9713e63c4327ca27a96cbdc8c))

## [1.27.11](https://github.com/etchteam/diamond-ui/compare/v1.27.10...v1.27.11) (2024-03-06)


### Bug Fixes

* key type ([defe826](https://github.com/etchteam/diamond-ui/commit/defe826f113fb1521ceaad7de057cd917104dffd))

## [1.27.10](https://github.com/etchteam/diamond-ui/compare/v1.27.9...v1.27.10) (2024-03-06)


### Bug Fixes

* don't force min height on button and input ([8ac7501](https://github.com/etchteam/diamond-ui/commit/8ac7501eef6ef81eced62ff6261ab28faaacb037))

## [1.27.9](https://github.com/etchteam/diamond-ui/compare/v1.27.8...v1.27.9) (2024-03-06)


### Bug Fixes

* icon size should be em ([af042b0](https://github.com/etchteam/diamond-ui/commit/af042b0f141e36b7b75c77747739f443b5ed653f))

## [1.27.8](https://github.com/etchteam/diamond-ui/compare/v1.27.7...v1.27.8) (2024-02-29)


Expand Down
2 changes: 1 addition & 1 deletion components/canvas/Card/Card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ declare global {
declare module 'react' {
namespace JSX {
interface IntrinsicElements {
'diamond-card': CardAttributes & JSXCustomElement;
'diamond-card': JSXCustomElement<CardAttributes>;
}
}
}
2 changes: 1 addition & 1 deletion components/canvas/Section/Section.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ declare global {
declare module 'react' {
namespace JSX {
interface IntrinsicElements {
'diamond-section': SectionAttributes & JSXCustomElement;
'diamond-section': JSXCustomElement<SectionAttributes>;
}
}
}
2 changes: 1 addition & 1 deletion components/composition/App/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ declare global {
declare module 'react' {
namespace JSX {
interface IntrinsicElements {
'diamond-app': AppAttributes & JSXCustomElement;
'diamond-app': JSXCustomElement<AppAttributes>;
}
}
}
2 changes: 1 addition & 1 deletion components/composition/Enter/Enter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ declare global {
declare module 'react' {
namespace JSX {
interface IntrinsicElements {
'diamond-enter': EnterAttributes & JSXCustomElement;
'diamond-enter': JSXCustomElement<EnterAttributes>;
}
}
}
2 changes: 1 addition & 1 deletion components/composition/FormGroup/FormGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ declare global {
declare module 'react' {
namespace JSX {
interface IntrinsicElements {
'diamond-form-group': FormGroupAttributes & JSXCustomElement;
'diamond-form-group': JSXCustomElement<FormGroupAttributes>;
}
}
}
2 changes: 1 addition & 1 deletion components/composition/Grid/Grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ declare global {
declare module 'react' {
namespace JSX {
interface IntrinsicElements {
'diamond-grid': GridAttributes & JSXCustomElement;
'diamond-grid': JSXCustomElement<GridAttributes>;
}
}
}
2 changes: 1 addition & 1 deletion components/composition/Grid/GridItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ declare global {
declare module 'react' {
namespace JSX {
interface IntrinsicElements {
'diamond-grid-item': GridItemAttributes & JSXCustomElement;
'diamond-grid-item': JSXCustomElement<GridItemAttributes>;
}
}
}
2 changes: 1 addition & 1 deletion components/composition/Wrap/Wrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ declare global {
declare module 'react' {
namespace JSX {
interface IntrinsicElements {
'diamond-wrap': WrapAttributes & JSXCustomElement;
'diamond-wrap': JSXCustomElement<WrapAttributes>;
}
}
}
2 changes: 1 addition & 1 deletion components/content/Img/Img.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ declare global {
declare module 'react' {
namespace JSX {
interface IntrinsicElements {
'diamond-img': ImgAttributes & JSXCustomElement;
'diamond-img': JSXCustomElement<ImgAttributes>;
}
}
}
76 changes: 75 additions & 1 deletion components/control/Button/Button.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,39 @@ diamond-button {
color: var(--_color);
cursor: pointer;
display: inline-flex;
font: inherit;
font-size: var(--_size, 1rem);
font-weight: var(--diamond-button-font-weight);
gap: var(--diamond-button-gap);
justify-content: center;
letter-spacing: inherit;
line-height: var(--_line-height);
padding-block: var(--_padding-block);
padding-inline: var(--_padding-inline);
-webkit-tap-highlight-color: transparent;
text-align: center;
text-decoration: none;
text-shadow: var(--diamond-button-text-shadow);
touch-action: manipulation;
-webkit-touch-callout: none;
transition:
background var(--diamond-transition),
color var(--diamond-transition),
border-color var(--diamond-transition),
outline-offset var(--diamond-transition);
user-select: none;

@media (hover: hover) {
&:hover {
--_background: var(--_background-hover);
--_border-color: var(--_border-color-hover);
--_color: var(--_color-hover);
}
}

&:not(:active):focus-visible {
outline-offset: var(--diamond-button-outline-offset);
}
}

svg {
Expand All @@ -34,7 +67,48 @@ diamond-button {
}
}

&[variant='primary'] > button {
&[size='sm'] {
--_size: 0.875rem;
}

&[size='lg'] {
--_size: 1.25rem;
}

&[width='full-width'] {
display: block;

button,
a,
input {
width: 100%;
}
}

@media (width < 480px) {
&[width='full-width-mobile'] {
display: block;

button,
a,
input {
width: 100%;
}
}
}

&[width='square'] {
--_line-height: 1;
--_padding-inline: var(--diamond-button-padding-block);

button,
a,
input {
aspect-ratio: 1 / 1;
}
}

&[variant='primary'] {
--_background: var(--diamond-button-primary-background);
--_background-hover: var(--diamond-button-primary-background-hover);
--_background-disabled: var(--diamond-button-primary-background-disabled);
Expand Down
14 changes: 14 additions & 0 deletions components/control/Button/Button.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,20 @@ export const TextButton: StoryObj = {
`,
};

export const Sizes: StoryObj = {
render: () => html`
<diamond-button size="sm">
<button type="button">Button</button>
</diamond-button>
<diamond-button size="md">
<button type="button">Button</button>
</diamond-button>
<diamond-button size="lg">
<button type="button">Button</button>
</diamond-button>
`,
};

export const IconOnlyButton: StoryObj = {
render: () => html`
<diamond-grid wrap="wrap" align-items="center">
Expand Down
2 changes: 1 addition & 1 deletion components/control/Button/Button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ declare global {
declare module 'react' {
namespace JSX {
interface IntrinsicElements {
'diamond-button': ButtonAttributes & JSXCustomElement;
'diamond-button': JSXCustomElement<ButtonAttributes>;
}
}
}
6 changes: 3 additions & 3 deletions components/control/Input/Input.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ diamond-input {
color: inherit;
display: block;
flex: 1 1 auto;
font-size: var(--diamond-input-font-size);
line-height: var(--diamond-input-line-height);
min-height: var(--diamond-spacing-thumb);
padding: var(--diamond-input-padding);

&:focus {
Expand Down Expand Up @@ -84,12 +84,12 @@ diamond-input {
/* Prefix */
&:has(* + :is(input, textarea, select)) > :first-child {
margin-right: calc(var(--diamond-input-padding-inline) / 2 * -1);
padding: 0 0 0 var(--diamond-input-padding-inline);
padding: 0 0 0 calc(var(--diamond-input-padding-inline) / 2);
}

/* Suffix */
:is(input, textarea, select) + * {
margin-left: calc(var(--diamond-input-padding-inline) / 2 * -1);
padding: 0 var(--diamond-input-padding-inline) 0 0;
padding: 0 calc(var(--diamond-input-padding-inline) / 2) 0 0;
}
}
2 changes: 1 addition & 1 deletion components/control/Input/Input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ declare global {
declare module 'react' {
namespace JSX {
interface IntrinsicElements {
'diamond-input': InputAttributes & JSXCustomElement;
'diamond-input': JSXCustomElement<InputAttributes>;
}
}
}
2 changes: 1 addition & 1 deletion components/control/RadioCheckbox/RadioCheckbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ declare global {
declare module 'react' {
namespace JSX {
interface IntrinsicElements {
'diamond-radio-checkbox': RadioCheckboxAttributes & JSXCustomElement;
'diamond-radio-checkbox': JSXCustomElement<RadioCheckboxAttributes>;
}
}
}
Loading

0 comments on commit 0277c3e

Please sign in to comment.