Skip to content

Commit

Permalink
Merge branch 'next' into chore/pkg-pr-new
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianGonz97 committed Jul 18, 2024
2 parents 72caeba + 04c4078 commit a27359c
Show file tree
Hide file tree
Showing 537 changed files with 32,520 additions and 17,327 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.18.2
v20.15.1
32 changes: 32 additions & 0 deletions NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Svelte 5 Related Notes:

- Determine how we're going to handle the `name` prop for the date field & date range field. Currently, it's passed to the root of the date field, but to the individual inputs for the date range field. It should probably be consistent across both components, opting to pass it to the input.

---

Determine how to handle validation for the various date components. My initial thought is we'll have a `validate` prop that gets called each time the user changes the date value of the component. This gives the user maximum flexibility to handle validation, but we'll need to ensure it's done so in an accessible manner.

Perhaps we can provide a `Validation` component that can be used to display validation messages. Whatever is returned from the `validate` function could be rendered in the `Validation` component as a fallback, or the user can provide their own message within its children. With this approach, we also need to determine how to then handle the cases of `minValue`, `maxValue`, and `isDateUnavailable` being set. Something to think about.

We could have some sort of `Validation` object that gets passed to an `onInvalid` callback prop that is called when the date value is invalid. It could look something like this:

```ts
type InvalidResult = {
type: "min" | "max" | "unavailable" | "custom"
message?: string;
}
```
Then the user can handle this in their own way, such as displaying a validation message in a `Validation` component, or calling a function that does whatever they need to do to handle the validation. Need to think more on this one.
---
We need to determine the ideal approach for managing the `data-<component>` attributes. We've decided to use a `data-<component>-root` attribute for the root component, and `data-<component>-<part>` for each part.
Since other components depend on these attributes for selectors, we'll need to put them in a place where they can be easily accessed and if changed, those changes will propagate to everywhere the attribute is used.
They also need to be flexible enough to allow for reusing the same component while swapping the `data-component` prefix, for example, in the menus we have `data-menubar-*`, `data-dropdown-menu-*`, `data-context-menu-*`, etc. The easy button is of course to just consolidate these into just a single `data-menu` attribute, but that's not ideal and hinders the ability to apply different styles on a global level to the different components.
---
Should we embrace the [ValidityState](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) API? Something to think about.
25 changes: 25 additions & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Bits UI
=================
The following is a list of sources from which code was used/modified in this codebase.

-------------------------------------------------------------------------------
This codebase contains a modified portion of code from Adobe which can be obtained at:
* SOURCE:
* https://www.npmjs.com/package/@react-aria/utils
* LICENSE:
* https://unpkg.com/@react-aria/utils@3.24.1/LICENSE

* SOURCE:
* https://www.npmjs.com/package/react-stately
* LICENSE:
* https://unpkg.com/react-stately@3.31.1/LICENSE

-------------------------------------------------------------------------------

This codebase contains a modified portion of code from Melt UI which can be obtained at:
* SOURCE:
* https://www.npmjs.com/package/@melt-ui/svelte
* LICENSE:
* https://unpkg.com/@melt-ui/svelte@0.76.2/LICENSE

-------------------------------------------------------------------------------
13 changes: 8 additions & 5 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import config, { DEFAULT_IGNORES } from "@huntabyte/eslint-config";

const ignores = ["**/extended-types"];

export default config({ svelte: true, ignores: [...DEFAULT_IGNORES, ...ignores] }).override(
"antfu/typescript/rules",
{
export default config({ svelte: true, ignores: [...DEFAULT_IGNORES, ...ignores] })
.override("antfu/typescript/rules", {
rules: {
"ts/consistent-type-definitions": "off",
"ts/ban-types": [
Expand All @@ -16,5 +15,9 @@ export default config({ svelte: true, ignores: [...DEFAULT_IGNORES, ...ignores]
},
],
},
}
);
})
.override("antfu/javascript/rules", {
rules: {
"no-unused-expressions": "off",
},
});
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"build:packages": "pnpm -F \"./packages/**\" --parallel build",
"check": "pnpm build:packages && pnpm -r check",
"ci:publish": "pnpm build:packages && changeset publish",
"dev": "pnpm -r --parallel dev",
"dev": "pnpm -F \"./packages/**\" svelte-kit sync && pnpm -r --parallel dev",
"format": "prettier --write .",
"lint": "prettier --check . && eslint .",
"lint:fix": "eslint --fix .",
Expand All @@ -18,15 +18,15 @@
"license": "MIT",
"devDependencies": {
"@changesets/cli": "^2.27.1",
"@huntabyte/eslint-config": "^0.3.1",
"@huntabyte/eslint-config": "^0.3.2",
"@huntabyte/eslint-plugin": "^0.1.0",
"@svitejs/changesets-changelog-github-compact": "^1.1.0",
"eslint": "^9.0.0",
"eslint-plugin-svelte": "^2.37.0",
"prettier": "^3.2.5",
"prettier-plugin-svelte": "^3.2.2",
"prettier-plugin-tailwindcss": "0.5.13",
"svelte": "5.0.0-next.148",
"svelte": "5.0.0-next.183",
"svelte-eslint-parser": "^0.34.1",
"wrangler": "^3.44.0"
},
Expand Down
7 changes: 7 additions & 0 deletions packages/bits-ui/other/setupTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,10 @@ vi.mock("$app/stores", (): typeof stores => {
// eslint-disable-next-line ts/no-require-imports
globalThis.ResizeObserver = require("resize-observer-polyfill");
Element.prototype.scrollIntoView = () => {};
Element.prototype.hasPointerCapture = (() => {}) as any;

// @ts-expect-error - shut it
globalThis.window.CSS.supports = (property: string, value: string) => true;

globalThis.document.elementsFromPoint = () => [];
globalThis.document.elementFromPoint = () => null;
48 changes: 24 additions & 24 deletions packages/bits-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bits-ui",
"version": "0.21.3",
"version": "0.21.4",
"license": "MIT",
"repository": "github:huntabyte/bits-ui",
"funding": "https://github.com/sponsors/huntabyte",
Expand Down Expand Up @@ -28,48 +28,48 @@
],
"devDependencies": {
"@melt-ui/pp": "^0.3.0",
"@sveltejs/kit": "^2.5.0",
"@sveltejs/package": "^2.2.7",
"@sveltejs/vite-plugin-svelte": "^3.1.0",
"@testing-library/dom": "^10.0.0",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/svelte": "^5.0.1",
"@sveltejs/kit": "^2.5.18",
"@sveltejs/package": "^2.3.2",
"@sveltejs/vite-plugin-svelte": "^3.1.1",
"@testing-library/dom": "^10.3.1",
"@testing-library/jest-dom": "^6.4.6",
"@testing-library/svelte": "^5.2.0",
"@testing-library/user-event": "^14.5.2",
"@types/jest-axe": "^3.5.9",
"@types/node": "^20.12.2",
"@types/node": "^20.14.10",
"@types/resize-observer-browser": "^0.1.11",
"@types/testing-library__jest-dom": "^5.14.9",
"@vitest/ui": "^1.5.0",
"csstype": "^3.1.3",
"jest-axe": "^8.0.0",
"jsdom": "^24.0.0",
"publint": "^0.2.7",
"jest-axe": "^9.0.0",
"jsdom": "^24.1.0",
"publint": "^0.2.8",
"resize-observer-polyfill": "^1.5.1",
"svelte": "5.0.0-next.148",
"svelte-check": "^3.6.9",
"tslib": "^2.6.2",
"typescript": "^5.3.3",
"vite": "^5.2.8",
"vitest": "^1.5.0"
"svelte": "5.0.0-next.183",
"svelte-check": "^3.8.4",
"tslib": "^2.6.3",
"typescript": "^5.5.3",
"vite": "^5.3.3",
"vitest": "^2.0.2"
},
"svelte": "./dist/index.js",
"types": "./dist/index.d.ts",
"type": "module",
"dependencies": {
"@floating-ui/core": "^1.6.0",
"@floating-ui/dom": "^1.6.3",
"@internationalized/date": "^3.5.1",
"@floating-ui/core": "^1.6.4",
"@floating-ui/dom": "^1.6.7",
"@internationalized/date": "^3.5.4",
"@melt-ui/svelte": "0.76.2",
"clsx": "^2.1.0",
"clsx": "^2.1.1",
"esm-env": "^1.0.0",
"nanoid": "^5.0.5",
"runed": "^0.5.0",
"nanoid": "^5.0.7",
"runed": "^0.15.0",
"scule": "^1.3.0",
"style-object-to-css-string": "^1.1.3",
"style-to-object": "^1.0.6",
"svelte-toolbelt": "^0.0.2"
},
"peerDependencies": {
"svelte": "^5.0.0"
"svelte": "^5.0.0-next.1"
}
}
Loading

0 comments on commit a27359c

Please sign in to comment.