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: include all type definitions in repo #1996

Merged
merged 18 commits into from
Feb 22, 2023
Merged
Show file tree
Hide file tree
Changes from 15 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
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ showTabs: true

| Properties | Description |
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `checked` | _(optional)_ determine whether the checkbox is checked or not. The default is `false`. |
| `checked` | _(optional)_ determine whether the checkbox is checked or not. The default is `false`. |
| `title` | _(optional)_ the `title` of the input - describing it a bit further for accessibility reasons. |
| `label` | _(optional)_ use either the `label` property or provide a custom one. |
| `label` | _(optional)_ use either the `label` property or provide a custom one. |
| `label_position` | _(optional)_ defines the position of the `label`. Use either `left` or `right`. Defaults to `right`. |
| `label_sr_only` | _(optional)_ use `true` to make the label only readable by screen readers. |
| `size` | _(optional)_ the size of the checkbox. For now there is **medium** (default) and **large**. |
| `status` | _(optional)_ text with a status message. The style defaults to an error message. You can use `true` to only get the status color, without a message. |
| `status_state` | _(optional)_ defines the state of the status. Currently, there are two statuses `[error, info]`. Defaults to `error`. |
| `status_state` | _(optional)_ defines the state of the status. Currently, there are two statuses `[error, info]`. Defaults to `error`. |
| `status_props` | _(optional)_ use an object to define additional FormStatus properties. |
| `global_status_id` | _(optional)_ the `status_id` used for the target [GlobalStatus](/uilib/components/global-status). |
| `skeleton` | _(optional)_ if set to `true`, an overlaying skeleton with animation will be shown. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export const DialogConfirmLoggedOut = () => {
setOpen(false)
loginHandler()
}}
labelled_by="custom-triggerer"
labelledBy="custom-triggerer"
/>
</>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export const InputExampleSuffix = () => (
autocomplete="on"
placeholder="Placeholder text"
suffix={
<HelpButton title="Info" trigger_size="large">
<HelpButton title="Info" size="large">
Some content
</HelpButton>
}
Expand Down Expand Up @@ -199,9 +199,6 @@ export const InputExampleSubmit = () => (
on_change={({ value }) => {
console.log('on_change:', value)
}}
onChange={({ value }) => {
console.log('onChange:', value)
}}
right="small"
bottom="x-small"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,31 @@ showTabs: true

| Properties | Description |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `value` | _(required)_ defines the `value` as a string. Use it to get the value during the `on_change` event listener callback in the **RadioGroup**. |
| `value` | _(required)_ defines the `value` as a string. Use it to get the value during the `on_change` event listener callback in the **RadioGroup**. |
| `checked` | _(optional)_ determine whether the radio is checked or not. Default will be `false`. |
| `group` | _(optional)_ use a unique group identifier to define the Radio buttons that belongs together. |
| `group` | _(optional)_ use a unique group identifier to define the Radio buttons that belongs together. |
| `size` | _(optional)_ the size of the Radio button. For now there is **medium** (default) and **large**. |
| `label` | _(optional)_ use either the `label` property or provide a custom one. |
| `label` | _(optional)_ use either the `label` property or provide a custom one. |
| `label_position` | _(optional)_ defines the position of the `label`. Use either `left` or `right`. Defaults to `right`. |
| `label_sr_only` | _(optional)_ use `true` to make the label only readable by screen readers. |
| `status` | _(optional)_ text with a status message. The style defaults to an error message. You can use `true` to only get the status color, without a message. |
| `status_state` | _(optional)_ defines the state of the status. Currently, there are two statuses `[error, info]`. Defaults to `error`. |
| `status_state` | _(optional)_ defines the state of the status. Currently, there are two statuses `[error, info]`. Defaults to `error`. |
| `status_props` | _(optional)_ use an object to define additional FormStatus properties. |
| `global_status_id` | _(optional)_ the `status_id` used for the target [GlobalStatus](/uilib/components/global-status). |

## Radio group properties

| Properties | Description |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `value` | _(optional)_ defines the pre-selected Radio button. The value has to match the one provided in the Radio button. Use a string value. |
| `name` | _(optional)_ custom grouping name. Defaults to a random name. |
| `value` | _(optional)_ defines the pre-selected Radio button. The value has to match the one provided in the Radio button. Use a string value. |
| `name` | _(optional)_ custom grouping name. Defaults to a random name. |
| `layout_direction` | _(optional)_ Define the layout direction of the Radio buttons. Can be either `column` or `row`. Defaults to `column`. |
| `size` | _(optional)_ the size of the Radio button. For now there is **medium** (default) and **large**. |
| `status` | _(optional)_ uses the `form-status` component to show failure messages. |
| `status_state` | _(optional)_ defines the state of the status. Currently, there are two statuses `[error, info]`. Defaults to `error`. |
| `status_state` | _(optional)_ defines the state of the status. Currently, there are two statuses `[error, info]`. Defaults to `error`. |
| `status_props` | _(optional)_ use an object to define additional FormStatus properties. |
| `global_status_id` | _(optional)_ the `status_id` used for the target [GlobalStatus](/uilib/components/global-status). |
| `label` | _(optional)_ use either the `label` property or provide a custom one. |
| `label` | _(optional)_ use either the `label` property or provide a custom one. |
| `label_direction` | _(optional)_ to define the `label` layout direction on how the next element should be placed on. Can be either `vertical` or `horizontal`. Defaults to `horizontal`. |
| `label_sr_only` | _(optional)_ use `true` to make the label only readable by screen readers. |
| `vertical` | _(optional)_ will force both `direction` and `label_direction` to be **vertical** if set to `true`. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ showTabs: true

| Properties | Description |
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `checked` | _(optional)_ determine whether the switch is checked or not. The default will be `false`. |
| `title` | _(required)_ the `title` of the input - describing it a bit further for accessibility reasons. |
| `label` | _(optional)_ use either the `label` property or provide a custom one. |
| `checked` | _(optional)_ determine whether the switch is checked or not. The default will be `false`. |
| `title` | _(required)_ the `title` of the input - describing it a bit further for accessibility reasons. |
| `label` | _(optional)_ use either the `label` property or provide a custom one. |
| `label_position` | _(optional)_ defines the position of the `label`. Use either `left` or `right`. Defaults to `right`. |
| `label_sr_only` | _(optional)_ use `true` to make the label only readable by screen readers. |
| `size` | _(optional)_ the size of the switch. For now there is **medium** (default) and **large**. |
| `status` | _(optional)_ text with a status message. The style defaults to an error message. You can use `true` to only get the status color, without a message. |
| `status_state` | _(optional)_ defines the state of the status. Currently, there are two statuses `[error, info]`. Defaults to `error`. |
| `status_state` | _(optional)_ defines the state of the status. Currently, there are two statuses `[error, info]`. Defaults to `error`. |
| `status_props` | _(optional)_ use an object to define additional FormStatus properties. |
| `global_status_id` | _(optional)_ the `status_id` used for the target [GlobalStatus](/uilib/components/global-status). |
| `suffix` | _(optional)_ text describing the content of the Switch more than the label. You can also send in a React component, so it gets wrapped inside the Switch component. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ const CodeBlock = ({
{...defaultProps}
code={String(exampleCode).trim()}
language={language}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
theme={prismTheme}
>
{({ className, style, tokens, getLineProps, getTokenProps }) => (
Expand Down
2 changes: 1 addition & 1 deletion packages/dnb-eufemia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"skeleton:font": "nodemon --exec 'babel-node --extensions .js,.ts,.tsx ./scripts/tools/createSkeletonFont.js'",
"start": "start-storybook -s / -p 8002 --ci --no-release-notes --no-version-updates",
"test": "jest",
"test:auto-generated-types": "jest ./postTypeGeneration.test.js --ci --testPathIgnorePatterns=[]",
"test:auto-generated-types": "jest ./postTypeGeneration.test.ts --ci --testPathIgnorePatterns=[]",
"test:ci": "jest --ci",
"test:screenshots": "jest --config=./jest.config.screenshots.js --detectOpenHandles --testPathPattern ",
"test:screenshots:ci": "jest --config=./jest.config.screenshots.js --ci --bail",
Expand Down
4 changes: 2 additions & 2 deletions packages/dnb-eufemia/scripts/postbuild/babel-cjs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ babel ./src \
--no-copy-ignored \
--ignore 'src/esm,src/umd,src/core,**/*.test.*,**/__tests__/**/*,**/*.stories.*,**/stories,**/*.d.ts'

echo 'Building cjs bundle done!'

echo 'Copy additional files to cjs ...'

OUT_DIR=./build/cjs babel-node --extensions .js,.ts,.tsx ./scripts/postbuild/copyTypeScriptFiles.js
Expand All @@ -25,3 +23,5 @@ OUT_DIR=./build/cjs babel-node --extensions .js,.ts,.tsx ./scripts/postbuild/cop
echo 'Copy extra cjs package.json ...'

cp ./src/cjs/package.json ./build/cjs/package.json

echo 'Building cjs bundle done!'
4 changes: 2 additions & 2 deletions packages/dnb-eufemia/scripts/postbuild/babel-es.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ babel ./src \
--no-copy-ignored \
--ignore 'src/cjs,src/esm,src/umd,src/core,**/*.test.*,**/__tests__/**/*,**/*.stories.*,**/stories,**/*.d.ts'

echo 'Building es bundle done!'

echo 'Copy additional files to es ...'

OUT_DIR=./build/es babel-node --extensions .js,.ts,.tsx ./scripts/postbuild/copyTypeScriptFiles.js
OUT_DIR=./build/es babel-node --extensions .js,.ts,.tsx ./scripts/postbuild/copyStyles.js

echo 'Building es bundle done!'
4 changes: 2 additions & 2 deletions packages/dnb-eufemia/scripts/postbuild/babel-esm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ babel ./src \
--no-copy-ignored \
--ignore 'src/cjs,src/esm,src/umd,src/core,**/*.test.*,**/__tests__/**/*,**/*.stories.*,**/stories,**/*.d.ts'

echo 'Building esm bundle done!'

echo 'Copy additional files to esm ...'

OUT_DIR=./build/esm babel-node --extensions .js,.ts,.tsx ./scripts/postbuild/copyTypeScriptFiles.js
OUT_DIR=./build/esm babel-node --extensions .js,.ts,.tsx ./scripts/postbuild/copyStyles.js

echo 'Building esm bundle done!'
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,7 @@ if (isCI) {
})
})
} else {
it('skipping local tests', () => {})
it('skipping local tests', () => {
return null
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,7 @@ if (isCI) {
})
})
} else {
it('skipping local tests', () => {})
it('skipping local tests', () => {
return null
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import * as getNextReleaseVersion from '../../../postbuild/getNextReleaseVersion
jest.mock('../../../postbuild/getNextReleaseVersion', () => {
return {
...jest.requireActual('../../../postbuild/getNextReleaseVersion'),
getNextReleaseVersion: jest.fn().mockResolvedValue(),
getNextReleaseVersion: jest.fn().mockResolvedValue(false),
}
})

jest.mock('fs-extra', () => {
return {
...jest.requireActual('fs-extra'),
writeFile: jest.fn().mockResolvedValue(),
writeFile: jest.fn().mockResolvedValue(false),
}
})

Expand Down
Loading