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

feat: combobox React package #2453

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .changeset/afraid-bugs-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@utrecht/listbox-react": major
---

Create React-listbox component package
5 changes: 5 additions & 0 deletions .changeset/clean-carrots-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@utrecht/textbox-react": minor
---

Re-export React Textbox component package
7 changes: 7 additions & 0 deletions .changeset/cuddly-balloons-ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@utrecht/component-library-react": patch
"@utrecht/button-react": patch
"@utrecht/calendar-react": patch
---

Fix the button style issue when importing it from `dist/css-module`.
31 changes: 31 additions & 0 deletions .changeset/cyan-forks-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
"@utrecht/combobox-css": minor
---

Create the rest CSS classes for the combobox elements.

The new classes:

- `utrecht-combobox__textbox-container`
- `utrecht-combobox__toggle-button`

```CSS
--utrecht-combobox-toggle-button-background-color: transparent; //default value
--utrecht-combobox-toggle-button-color: currentColor; //default value
--utrecht-combobox-toggle-button-hover-background-color: transparent; //default value
--utrecht-combobox-toggle-button-hover-color: currentColor; //default value
--utrecht-combobox-toggle-button-active-background-color: transparent; //default value
--utrecht-combobox-toggle-button-active-color: currentColor; //default value
--utrecht-combobox-toggle-button-focus-background-color: transparent; //default value
--utrecht-combobox-toggle-button-focus-color: currentColor; //default value
--utrecht-combobox-toggle-button-pressed-background-color: transparent; //default value
--utrecht-combobox-toggle-button-pressed-color: currentColor; //default value
```

- `utrecht-combobox__icon`

```CSS
--utrecht-combobox-icon-size: 32px; //default value
```

-
5 changes: 5 additions & 0 deletions .changeset/fair-books-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@utrecht/storybook-react": minor
---

Add Combobox stories
5 changes: 5 additions & 0 deletions .changeset/large-dots-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@utrecht/component-library-react": minor
---

Re-export FormLabel-react component
5 changes: 5 additions & 0 deletions .changeset/light-trees-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@utrecht/component-library-react": minor
---

Re-export `FormFieldCombobox` component package
5 changes: 5 additions & 0 deletions .changeset/rare-carrots-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@utrecht/combobox-react": major
---

Create React combobox component
5 changes: 5 additions & 0 deletions .changeset/rotten-deers-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@utrecht/form-field-react": major
---

Create form-field-react package
5 changes: 5 additions & 0 deletions .changeset/shiny-plants-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@utrecht/listbox-css": patch
---

Fix the listbox width on small screens
5 changes: 5 additions & 0 deletions .changeset/sixty-worms-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@utrecht/component-library-react": minor
---

Re-export React Listbox component package
5 changes: 5 additions & 0 deletions .changeset/slimy-baboons-grab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@utrecht/form-field-combobox-react": major
---

Create `FormFieldCombobox` react package
5 changes: 5 additions & 0 deletions .changeset/strange-pigs-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@utrecht/form-label-react": major
---

Create FormLabel react component package
5 changes: 5 additions & 0 deletions .changeset/tasty-socks-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@utrecht/component-library-react": minor
---

Re-export the new React-Combobox
5 changes: 5 additions & 0 deletions .changeset/tough-feet-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@utrecht/component-library-react": minor
---

Re-export FormField-react component
5 changes: 5 additions & 0 deletions .changeset/witty-jobs-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@utrecht/textbox-react": major
---

Create React Textbox component package
4 changes: 3 additions & 1 deletion .github/workflows/continuous-delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ jobs:
- name: Install dependencies
run: |
pnpm install

- name: "Continuous Integration: build"
run: |
pnpm run --if-present build
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

- name: "Continuous Integration: test"
run: |
pnpm run --if-present test
Expand Down
48 changes: 48 additions & 0 deletions components/combobox/src/_mixin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,51 @@
@mixin utrecht-combobox__popover--hidden {
display: none !important;
}

@mixin utrecht-combobox__textbox-container {
align-items: center;
box-sizing: border-box;
display: flex;
inline-size: var(--utrecht-listbox-inline-size);
max-inline-size: 100%;
position: relative;
}
@mixin utrecht-combobox__toggle-button {
--utrecht-button-subtle-background-color: var(--utrecht-combobox-toggle-button-background-color, transparent);
--utrecht-button-subtle-color: var(--utrecht-combobox-toggle-button-color, currentColor);
--utrecht-button-subtle-hover-background-color: var(
--utrecht-combobox-toggle-button-hover-background-color,
transparent
);
--utrecht-button-subtle-hover-border-color: transparent;
--utrecht-button-subtle-hover-color: var(--utrecht-combobox-toggle-button-hover-color, currentColor);
--utrecht-button-hover-scale: none;
--utrecht-button-subtle-active-border-color: transparent;
--utrecht-button-subtle-active-background-color: var(
--utrecht-combobox-toggle-button-active-background-color,
transparent
);
--utrecht-button-subtle-active-color: var(--utrecht-combobox-toggle-button-active-color, currentColor);
--utrecht-button-subtle-focus-border-color: transparent;
--utrecht-button-subtle-focus-background-color: var(
--utrecht-combobox-toggle-button-focus-background-color,
transparent
);
--utrecht-button-subtle-focus-color: var(--utrecht-combobox-toggle-button-focus-color, currentColor);
--utrecht-button-subtle-pressed-background-color: var(
--utrecht-combobox-toggle-button-pressed-background-color,
transparent
);
--utrecht-button-subtle-pressed-border-color: transparent;
--utrecht-button-subtle-pressed-color: var(--utrecht-combobox-toggle-button-pressed-color, currentColor);

inset-block-start: 50%;
inset-inline-end: 0;
position: absolute;
transform: translateY(-50%);
}

@mixin utrecht-combobox__icon {
block-size: var(--utrecht-combobox-icon-size, 32px);
inline-size: var(--utrecht-combobox-icon-size, 32px);
}
12 changes: 12 additions & 0 deletions components/combobox/src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,15 @@
.utrecht-combobox__popover--hidden {
@include utrecht-combobox__popover--hidden;
}

.utrecht-combobox__textbox-container {
@include utrecht-combobox__textbox-container;
}

.utrecht-combobox__toggle-button {
@include utrecht-combobox__toggle-button;
}

.utrecht-combobox__icon {
@include utrecht-combobox__icon;
}
162 changes: 162 additions & 0 deletions components/combobox/src/tokens.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
{
"utrecht": {
"combobox": {
"max-inline-size": {
"$extensions": {
"nl.nldesignsystem.css.property": {
"syntax": "<length>",
"inherits": true
},
"nl.nldesignsystem.figma.supports-token": true
},
"type": "spacing"
},
"border-color": {
"$extensions": {
"nl.nldesignsystem.css.property": {
"syntax": "<color>",
"inherits": true
},
"nl.nldesignsystem.figma.supports-token": true
},
"type": "color"
},
"input": {
"container": {
"inline-size": {
"$extensions": {
"nl.nldesignsystem.css.property": {
"syntax": "<length>",
"inherits": true
},
"nl.nldesignsystem.figma.supports-token": true
},
"type": "spacing"
}
}
},
"toggle-button": {
"background-color": {
"$extensions": {
"nl.nldesignsystem.css.property": {
"syntax": "<color>",
"inherits": true
},
"nl.nldesignsystem.figma.supports-token": true
},
"type": "color"
},
"color": {
"$extensions": {
"nl.nldesignsystem.css.property": {
"syntax": "<color>",
"inherits": true
},
"nl.nldesignsystem.figma.supports-token": true
},
"type": "color"
},
"hover": {
"background-color": {
"$extensions": {
"nl.nldesignsystem.css.property": {
"syntax": "<color>",
"inherits": true
},
"nl.nldesignsystem.figma.supports-token": true
},
"type": "color"
},
"color": {
"$extensions": {
"nl.nldesignsystem.css.property": {
"syntax": "<color>",
"inherits": true
},
"nl.nldesignsystem.figma.supports-token": true
},
"type": "color"
}
},
"active": {
"background-color": {
"$extensions": {
"nl.nldesignsystem.css.property": {
"syntax": "<color>",
"inherits": true
},
"nl.nldesignsystem.figma.supports-token": true
},
"type": "color"
},
"color": {
"$extensions": {
"nl.nldesignsystem.css.property": {
"syntax": "<color>",
"inherits": true
},
"nl.nldesignsystem.figma.supports-token": true
},
"type": "color"
}
},
"focus": {
"background-color": {
"$extensions": {
"nl.nldesignsystem.css.property": {
"syntax": "<color>",
"inherits": true
},
"nl.nldesignsystem.figma.supports-token": true
},
"type": "color"
},
"color": {
"$extensions": {
"nl.nldesignsystem.css.property": {
"syntax": "<color>",
"inherits": true
},
"nl.nldesignsystem.figma.supports-token": true
},
"type": "color"
}
},
"pressed": {
"background-color": {
"$extensions": {
"nl.nldesignsystem.css.property": {
"syntax": "<color>",
"inherits": true
},
"nl.nldesignsystem.figma.supports-token": true
},
"type": "color"
},
"color": {
"$extensions": {
"nl.nldesignsystem.css.property": {
"syntax": "<color>",
"inherits": true
},
"nl.nldesignsystem.figma.supports-token": true
},
"type": "color"
}
}
},
"icon": {
"size": {
"$extensions": {
"nl.nldesignsystem.css.property": {
"syntax": "<length>",
"inherits": true
},
"nl.nldesignsystem.figma.supports-token": true
},
"type": "spacing"
}
}
}
}
}
1 change: 1 addition & 0 deletions components/listbox/src/_mixin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
font-weight: var(--utrecht-listbox-font-weight, var(--utrecht-form-control-font-weight, initial));
inline-size: var(--utrecht-listbox-inline-size, var(--utrecht-form-control-max-inline-size));
max-block-size: var(--utrecht-listbox-max-block-size);
max-inline-size: 100%;
min-block-size: 1em;
overflow-block: auto;
overflow-y: auto;
Expand Down
3 changes: 0 additions & 3 deletions packages/component-library-react/jest.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ const customJestConfig = {
testEnvironment: 'jest-environment-jsdom',
testPathIgnorePatterns: ['/dist/'],
// transformIgnorePatterns: ['node_modules/(?!@utrecht/web-component-library-react)'],
moduleNameMapper: {
'^@utrecht/(.*)$': '<rootDir>/packages/$1/src/',
},
};

export default createJestConfig(customJestConfig);
Loading