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

🕰️ NEW: formatDate #137

Merged
merged 31 commits into from
Jan 3, 2024
Merged

🕰️ NEW: formatDate #137

merged 31 commits into from
Jan 3, 2024

Conversation

jycouet
Copy link
Collaborator

@jycouet jycouet commented Nov 20, 2023

DO NOT MERGE

Link to: #136

Copy link

changeset-bot bot commented Nov 20, 2023

🦋 Changeset detected

Latest commit: acba2a9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte-ux Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Nov 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
svelte-ux ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 4:28am

Copy link

cloudflare-pages bot commented Dec 20, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: acba2a9
Status: ✅  Deploy successful!
Preview URL: https://f77463d0.svelte-ux.pages.dev
Branch Preview URL: https://feat-formatdate.svelte-ux.pages.dev

View logs

@techniq

This comment was marked as resolved.

@jycouet

This comment was marked as resolved.

@jycouet
Copy link
Collaborator Author

jycouet commented Dec 31, 2023

@techniq
Copy link
Owner

techniq commented Dec 31, 2023

Reading #150 and with my current progress, I think that we have to do some choices now :).

For yesterday, 3 days ago, ... this is working well: https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat

For date format, ... this is working well: https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat

I started to add a dico, for things that I can't find in intl in a robust way. https://github.com/techniq/svelte-ux/blob/feat/formatDate/packages/svelte-ux/src/lib/utils/date.ts#L97-L105

I think that we will not get rid of date-fns as there are so many good utilities and intl is only about formatting. But, I think that formatting should be done in 1 single way either intl either date-fns, but not both (my current state!)

intl

  • It's cool as it's native js support (less to ship in the browser)
  • It's cool as it's similar to number that we did before
  • It's cool, with 1 string, it's supports so many locales!
  • It's not cool as it will be a breaking change for the lib (https://svelte-ux.techniq.dev/docs/components/DateField format will have to be done another way)

date-fns for formatting

  • people will be forced to add locales of date-fns
  • keeping the way it's done
  • less work as it's spread in a lot of places
  • convenient for DateField format

I really like the idea of using Intl for all the reasons you mentioned, especially not having to manage/download locales (i.e. date-fns/locale) and the simplicity/consistency. With that said, when I took a look at the PR preview playground, I was initial surprised by the DateField format until I realized that what one of the things you mentioned :).

image

I also think date-fns provides a lot of additional utility beyond formatting so I'm good with keeping it.

For DateField format default, I wonder if we just keep our own locale/format lookup for this use case.

const defaultFormat = {
  en: 'MM/dd/yyyy',
  fr: 'dd/MM/yyyy',
  ...
}

if we overlook one, we could have it just default to 'MM/dd/yyyy' and if a user complains, we'll know which one we missed :).

We could also take a date like 2023-11-21, format it using toLocaleDateString(locale), then parse where the values ended up, but this might be overkill.

I think the simple map might be the best, as for a default, just getting MDY or DMY or YMD right is good enough. I think always using / as a divider is probably fine too, although I know some locales (or even personal preference) might want to use - or ..

Looking at https://en.wikipedia.org/wiki/Date_format_by_country and https://docs.oracle.com/cd/E19455-01/806-0169/overview-7/index.html, I think we could build up this list fairly easily. Maybe even make it a case statement to simplify the impl (including handling the fallback default).

Lastly, I think we should expose this format on settings() for when a dev/user wants to override the format.

How does that sound? We can try to sync up in a few days and chat about it further if you want too.

@jycouet
Copy link
Collaborator Author

jycouet commented Dec 31, 2023

Oups, I just read your message after spending my all afternoon on it 🤣🤞
But, I think we are thinking the same way, hahaha

Check out the update ✅

I love all tests, I'm ssssoooo confident moving things around. And if something is not tracked, it's easy to add it 👍
I tried to clean as much as possible.

I think that I would like to remove dateDisplay! to really cut format from date-fns, but it might break some people code... So I don't know....

I'll do a break now to party a bit 🎉
Speak to you soon


FYI, love it:
Capture d’écran 2023-12-31 à 19 06 57

@techniq
Copy link
Owner

techniq commented Dec 31, 2023

Happy New Year (not quite here yet)! You've been busy 😅.

I love the idea of removing dateDisplay / consolidating into a single date format function for all use cases (or requiring dateFns format() directly when needed). I know there is a little usage of dateDisplay within LayerChart. There was even a commit that switched from dateFns's format() to dateDisplay(..., { format: ... }) to better handle null so it's not a 100% drop in if we require dateFns for this kind of formatting, but I'm not against it. If you're planning to support custom format strings in formatDate() that would be awesome too (it could still use dateFns, but then I guess we're back with dealing with locales in this case). We might just need to support more PeriodTypes for example time-only (h:mm:ss). Full disclosure: PeriodType has/had a tight coupling with a backend aggregation solution in one of my projects. I no longer work on that project, so I'm not as concerned anymore :).

Regarding the variants, currently we have short, and long. I've considered switching this to sm, lg and supporting md, xxs, xl, 2xl, etc (similar to Tailwind breakpoints) as needed. If we do switch to this variant naming, we should do the same for duration / Duration.

@jycouet
Copy link
Collaborator Author

jycouet commented Jan 1, 2024

breakpoint

I'm not a big big fan of short & long, I added default & custom, and now I think that it's "ok".
But I like even less sm, lg, md, ...

I think that it's hard to find 6 different levels of display of a year for example! (And then, at what breakpoint you go from yy to yyyy?) => I always forget levels & breakpoints... Ok you could customize... But then, it's too much of flexibility as of today. (My 2 cents)
d, dd, eee... All this is Day, what breakpoint is what?
I think that breakpoints don't fit, maybe I'm missing something?
Maybe you change my mind with some idea of "why"?

That's why I was thinking:

  • Default => Ok, by default what do we want?
  • Short => Let's have a good short version
  • Long => Let's have a good long version
  • Custom => to escape and do what you want

Often, Default is or short or long... (but not always the same).
I'm almost thinking: "do we even need short & long"?

dateDisplay

. If you're planning to support custom format strings in formatDate() that would be awesome too (it could still use dateFns, but then I guess we're back with dealing with locales in this case)

The custom, is already doing "a lot", and we can handle more and more cases if we have feedback.

I'll look into your commit and add different flags to help doing the same.

side node

The fns format "MM d, yyyy" is equivalent to intl format "d MM yyyy", because my "transform" takes care only about tokens, and locales + intl will do the right thing for US => "MM d, yyyy" 😉
I'm pretty happy about this cool trick. (You can also keep "MM d, yyyy")
Just not sure how to document this.

@techniq
Copy link
Owner

techniq commented Jan 1, 2024

Breakpoint

Good points, I think it would be too much customization (especially to support). FWIW, it's not based on viewport/breakpoints, mostly usage based on available real estate / context. For example, LayerChart axis labels typically use short for dates since a simple MM/YY is enough context (and space constrained), and you typically use a tooltip to get more details on the date (get year, day of week, etc). This screenshot isn't the best example, but does show the concept a little.

image

So really short / long is based on usage, but I like default and custom. I wonder if we need custom but allow you to change short and long (similar to the number presets of decimal, currency, etc) and maybe let default allow you to specify short and long only? Trying to find the sweet spot of simplicity but not overly restrictive is a delicate balance. Thoughts?

dateDisplay

I need to get myself up to speed on DateTimeFormat and read through the PR closer, but it all sounds great. It looks like you are mapping unicode date tokens (aka date-fns format string) to DateTimeFormat options (i.e. 'long', 'short', '2-digit', 'numeric', narrow, undefined, ...). Looking on MDN, I was having trouble finding the full list of available options for each date part (year, month, day, etc). Did you find a good reference?

side node

Kind of what I mentioned above, but really we're translating unicode format strings and mapping them to DateTimeFormat options. Do this mean MM/dd/yyyy and MM-dd-yyyy and yyyy-MM-dd will also result in the same output string based on the locale, or can you still keep the explicit formatting? I'm assuming no, which is probably OK (and using date-fns format() directly when needed is probably best for this). How to document this (and if there is a better approach to make this more obvious if so). Basically all that matters is each part's definition, and not the order or separators.

Side note: I'm really liking how this is coming together and I REALLY appreciate you digging in. I knew it wouldn't be a small task, but this will be another huge improvement to Svelte UX. Thanks for all the effort!

@techniq techniq changed the base branch from main to next January 3, 2024 04:24
@techniq techniq mentioned this pull request Jan 3, 2024
26 tasks
@techniq techniq merged commit 1b86701 into next Jan 3, 2024
5 checks passed
techniq pushed a commit that referenced this pull request Jan 4, 2024
* re init my mess dates

* update for consistency

* moving format to intl

* tests with also fr local

* dico

* dateDisplay update

* Humm

* tmp rename to format_fns

* realignement & doc update

* add a playground

* Month & monthYear

* DateField

* Date Range

* Month done

* rmv all usage of dateDisplay

* Nice nice nice

* casing

* enums casing

* oups, need to comment fr for now in the doc

* formats

* okay with date of week

* update docs

* add changeset

* rmv dateDisplay

* cleanup

* dico

* keep Day default

* rmv useless

* Okay, adding DayTime & TimeOnly

* of course, updating doc is always good :)

* Swtich default to use Tokens enum
techniq pushed a commit that referenced this pull request Jan 4, 2024
* re init my mess dates

* update for consistency

* moving format to intl

* tests with also fr local

* dico

* dateDisplay update

* Humm

* tmp rename to format_fns

* realignement & doc update

* add a playground

* Month & monthYear

* DateField

* Date Range

* Month done

* rmv all usage of dateDisplay

* Nice nice nice

* casing

* enums casing

* oups, need to comment fr for now in the doc

* formats

* okay with date of week

* update docs

* add changeset

* rmv dateDisplay

* cleanup

* dico

* keep Day default

* rmv useless

* Okay, adding DayTime & TimeOnly

* of course, updating doc is always good :)

* Swtich default to use Tokens enum
techniq pushed a commit that referenced this pull request Jan 5, 2024
* re init my mess dates

* update for consistency

* moving format to intl

* tests with also fr local

* dico

* dateDisplay update

* Humm

* tmp rename to format_fns

* realignement & doc update

* add a playground

* Month & monthYear

* DateField

* Date Range

* Month done

* rmv all usage of dateDisplay

* Nice nice nice

* casing

* enums casing

* oups, need to comment fr for now in the doc

* formats

* okay with date of week

* update docs

* add changeset

* rmv dateDisplay

* cleanup

* dico

* keep Day default

* rmv useless

* Okay, adding DayTime & TimeOnly

* of course, updating doc is always good :)

* Swtich default to use Tokens enum
@techniq techniq mentioned this pull request Jan 5, 2024
techniq pushed a commit that referenced this pull request Jan 6, 2024
* re init my mess dates

* update for consistency

* moving format to intl

* tests with also fr local

* dico

* dateDisplay update

* Humm

* tmp rename to format_fns

* realignement & doc update

* add a playground

* Month & monthYear

* DateField

* Date Range

* Month done

* rmv all usage of dateDisplay

* Nice nice nice

* casing

* enums casing

* oups, need to comment fr for now in the doc

* formats

* okay with date of week

* update docs

* add changeset

* rmv dateDisplay

* cleanup

* dico

* keep Day default

* rmv useless

* Okay, adding DayTime & TimeOnly

* of course, updating doc is always good :)

* Swtich default to use Tokens enum
@techniq techniq mentioned this pull request Jan 7, 2024
9 tasks
techniq pushed a commit that referenced this pull request Jan 9, 2024
* re init my mess dates

* update for consistency

* moving format to intl

* tests with also fr local

* dico

* dateDisplay update

* Humm

* tmp rename to format_fns

* realignement & doc update

* add a playground

* Month & monthYear

* DateField

* Date Range

* Month done

* rmv all usage of dateDisplay

* Nice nice nice

* casing

* enums casing

* oups, need to comment fr for now in the doc

* formats

* okay with date of week

* update docs

* add changeset

* rmv dateDisplay

* cleanup

* dico

* keep Day default

* rmv useless

* Okay, adding DayTime & TimeOnly

* of course, updating doc is always good :)

* Swtich default to use Tokens enum
techniq pushed a commit that referenced this pull request Jan 11, 2024
* re init my mess dates

* update for consistency

* moving format to intl

* tests with also fr local

* dico

* dateDisplay update

* Humm

* tmp rename to format_fns

* realignement & doc update

* add a playground

* Month & monthYear

* DateField

* Date Range

* Month done

* rmv all usage of dateDisplay

* Nice nice nice

* casing

* enums casing

* oups, need to comment fr for now in the doc

* formats

* okay with date of week

* update docs

* add changeset

* rmv dateDisplay

* cleanup

* dico

* keep Day default

* rmv useless

* Okay, adding DayTime & TimeOnly

* of course, updating doc is always good :)

* Swtich default to use Tokens enum
techniq pushed a commit that referenced this pull request Jan 11, 2024
* re init my mess dates

* update for consistency

* moving format to intl

* tests with also fr local

* dico

* dateDisplay update

* Humm

* tmp rename to format_fns

* realignement & doc update

* add a playground

* Month & monthYear

* DateField

* Date Range

* Month done

* rmv all usage of dateDisplay

* Nice nice nice

* casing

* enums casing

* oups, need to comment fr for now in the doc

* formats

* okay with date of week

* update docs

* add changeset

* rmv dateDisplay

* cleanup

* dico

* keep Day default

* rmv useless

* Okay, adding DayTime & TimeOnly

* of course, updating doc is always good :)

* Swtich default to use Tokens enum
techniq pushed a commit that referenced this pull request Jan 31, 2024
* re init my mess dates

* update for consistency

* moving format to intl

* tests with also fr local

* dico

* dateDisplay update

* Humm

* tmp rename to format_fns

* realignement & doc update

* add a playground

* Month & monthYear

* DateField

* Date Range

* Month done

* rmv all usage of dateDisplay

* Nice nice nice

* casing

* enums casing

* oups, need to comment fr for now in the doc

* formats

* okay with date of week

* update docs

* add changeset

* rmv dateDisplay

* cleanup

* dico

* keep Day default

* rmv useless

* Okay, adding DayTime & TimeOnly

* of course, updating doc is always good :)

* Swtich default to use Tokens enum
techniq pushed a commit that referenced this pull request Feb 6, 2024
* re init my mess dates

* update for consistency

* moving format to intl

* tests with also fr local

* dico

* dateDisplay update

* Humm

* tmp rename to format_fns

* realignement & doc update

* add a playground

* Month & monthYear

* DateField

* Date Range

* Month done

* rmv all usage of dateDisplay

* Nice nice nice

* casing

* enums casing

* oups, need to comment fr for now in the doc

* formats

* okay with date of week

* update docs

* add changeset

* rmv dateDisplay

* cleanup

* dico

* keep Day default

* rmv useless

* Okay, adding DayTime & TimeOnly

* of course, updating doc is always good :)

* Swtich default to use Tokens enum
techniq pushed a commit that referenced this pull request Feb 6, 2024
* re init my mess dates

* update for consistency

* moving format to intl

* tests with also fr local

* dico

* dateDisplay update

* Humm

* tmp rename to format_fns

* realignement & doc update

* add a playground

* Month & monthYear

* DateField

* Date Range

* Month done

* rmv all usage of dateDisplay

* Nice nice nice

* casing

* enums casing

* oups, need to comment fr for now in the doc

* formats

* okay with date of week

* update docs

* add changeset

* rmv dateDisplay

* cleanup

* dico

* keep Day default

* rmv useless

* Okay, adding DayTime & TimeOnly

* of course, updating doc is always good :)

* Swtich default to use Tokens enum
techniq pushed a commit that referenced this pull request Feb 6, 2024
* re init my mess dates

* update for consistency

* moving format to intl

* tests with also fr local

* dico

* dateDisplay update

* Humm

* tmp rename to format_fns

* realignement & doc update

* add a playground

* Month & monthYear

* DateField

* Date Range

* Month done

* rmv all usage of dateDisplay

* Nice nice nice

* casing

* enums casing

* oups, need to comment fr for now in the doc

* formats

* okay with date of week

* update docs

* add changeset

* rmv dateDisplay

* cleanup

* dico

* keep Day default

* rmv useless

* Okay, adding DayTime & TimeOnly

* of course, updating doc is always good :)

* Swtich default to use Tokens enum
techniq added a commit that referenced this pull request Feb 12, 2024
* Link npm downloads badge to npm package page

* 🕰️ NEW: formatDate (#137)

* re init my mess dates

* update for consistency

* moving format to intl

* tests with also fr local

* dico

* dateDisplay update

* Humm

* tmp rename to format_fns

* realignement & doc update

* add a playground

* Month & monthYear

* DateField

* Date Range

* Month done

* rmv all usage of dateDisplay

* Nice nice nice

* casing

* enums casing

* oups, need to comment fr for now in the doc

* formats

* okay with date of week

* update docs

* add changeset

* rmv dateDisplay

* cleanup

* dico

* keep Day default

* rmv useless

* Okay, adding DayTime & TimeOnly

* of course, updating doc is always good :)

* Swtich default to use Tokens enum

* Design tokens / Theme support (with dark mode) (#146)

* Squash all theme changes into single commit

* Add changeset

* Enter prerelease mode and version packages

* Add Kbd component.  Show keyboard shortcuts on ThemeButton menu

* Read themes/colors from tailwind config, including Daisy UI (with mapping).  Supports generating optional colors and further extension and flexability.

* Process daisy themes to generate lightThemes/darkThemes based on color-scheme value

* Add changeset

* Version bump to 0.58.0-next.1

* Add styles (with daisy) as top-level export

* Version bump to 0.58.0-next.2

* Add commonjs and esm versions of daisy module

* Version bump to 0.58.0-next.3

* Remove daisy from top-level exports

* Version bump to 0.58.0-next.4

* Rename `error` / `error-content` to `danger` / `danger-content`

* Fix pnpm-lock.yaml using `pnpm install` (ERR_PNPM_ERR_PNPM_UNEXPECTED_PKG_CONTENT_IN_STORE  The lockfile is broken! Resolution step will be performed to fix it.)

* Add `accent` and `neutral` theme colors

* Cleanup

* Update some leftover `error` => `danger` color references

* Extra tailwind plugin into multiple files for better readability

* Use darker "-content" color for default `fill` variant (distinguish from `fill-light`)

* Simplify naming and impl. of foregroundColor() and add lightenColor() (to match darkenColor())

* Register 100-900 shades for all semantic and state colors.  Replace color-mix() usage (including Tailwind *-mix-* utils) with new shades

* Use lib/styles/themes for types as well

* Replace SvelteComponentTyped with SvelteComponent

* Version bump to 0.58.0-next.5

* Cleanup

* Remove unused css files

* Simplify

* Support changing colorSpace (rgb, hsl, or oklch)

* Improve theme page preview and add menu item

* Improve default border color

* Fix handling of hsl() color space by clamping to RGB values (to not exceed 100% saturation or lightness).  Matches rgb() color

* Version bump to 0.58.0-next.6

* Use same surface-content/20% outline color as border color

* Remove explicit border colors that match default (border-surface-content/20) and replace some border-surface-### with default (surface-content/20)

* Version bump to 0.58.0-next.7

* Change "theme" to "classes" in Settings (#172)

* Rename settings `theme` to `classes` in preparation for adding theme support

* Rename getComponentTheme to getComponentClasses

* Add svelte settings to .prettierrc (#173)

* Theme store (#174)

* Move theme management to a store that lives in the context

* changeset

* Use cross-framework-compatible browser value

* handle post-load changes in prefers-color-scheme

* better browser stub-out

* Move culori to be a regular dependency so that all package managers will install it (#175)

* add ThemeInit component that place script inside <head> tag (#176)

* add ThemeInit component that place script inside <head> tag

* Fix bug

* proper sorting

* instantiate ThemeInit inside Settings component

* add comment about stringified function

* Version bump to 0.58.0-next.8

* Improve dark scheme icon

* Rename `ThemeButton` to `ThemeSelect`

* Add `ThemeSwitch` component to toggle between light/dark theme

* Generate `-50` shade for an option lighter than `-100`

* Update Settings component to expose each settings value as its own component prop (#177)

* Format project (fix lint failure)

* Update tailwind plugin to only generate shade colors if not present in theme (ex. Skeleton provides the shades 100-900).  Map `{color}-500` to `{color}` if not defined. Generate neutral color if not defined

* Map Skeleton themes to Svelte UX themes

* Switch Daisy UI themes back as the default (for now, until a more robust solution is available)

* refacto peer dev (#201)

* refacto peer dev

* @changesets/cli is only for library developers

* rehype-slug is only for the `svelte-ux` doc it can go to devDep

* @fortawesome/free-solid-svg-icons is only in the doc

* Move format function definitions onto settings to avoid calling getSettings after component initialization (#191)

* move format functions onto settings object

* update uses of formatting functions to fit new settings paradigm

* start transferring to store-based locale settings

* checkpoint

* update templates, add back custom date formatting

* upadte format samples

* update number tests

* clean up custom variant a bit, improve format function type definition

* remove date and number subformatters

* fixes

* fix missing style

* better label

* allow setting locale to one not explicitly supported

* fix a few old format calls

* add function type possibility to column format

* [formatNumber] Fix default style handling and update tests

* Locale support cleanup (#202)

* fix circular reference

* remove knownLocales

* fix date tests

* add locale exports, hide exports of a few internal-only functions

* changeset

* Format last qol for next (#203)

* add WeekStartsOn defaults depending on the locale

* init a Language Select comp

* Theme generator (#192)

* Rename `cssVars` action to `styleVars` and do not prefix properties with `--` by default (more flexible)

* [SelectField] Fix toggling display of options menu using toggleIcon. Ignore toggling when clicking on SelectField border.  Support hiding toggleIcon (`<SelectField toggleIcon={null} />

* [SelectField] Add `stepper` prop to iterate through options (like `MenuField`)

* [MenuField] Expose `selected` option via prop (similar to `SelectField`)

* [SelectField Add stepper example

* Move `processThemeColors()` from tailwind plugin to $lib/styles/theme to allow calling at runtime (theme generator frontend).  Add types

* Update skeleton.ts to match skeleton.cjs (to be removed)

* Beginning work of theme generator

* Read themes from `themes.json` file for both tailwind config and theme selector.  Remove daisy/skeleton commonjs modules.  Add `getThemeNames` to split based on `color-scheme`.  Ultimately simplifies a lot

* Add "Copy all" daisy and skeleton options

* Use <ThemeSelect> or <ThemeSwitch> based on more than 1 light/dark theme

* Fix skeleton dark themes after refactor

* Add explicit daisy themeName list to hopefully fix build (similar to skeleton)

* Set initial theme selections (fix reactivity infinite loop)

* [SelectField] Use `selectValue(...)` instead of `value = ...` so `change` is dispatched (and other consistent updating)

* Change light/dark preview based on which input was last changed

* Support overriding doc themes wtih generator (custom) themes

* Fix setting `prefers-color-scheme: dark` override

* Use a local copy of Skeleton themes to fix Cloudflare build (work around Node.js runtime issue)

* Improve handling of `-50` shade when `-100` exists (ex. Skeleton)

* Update site dark/light mode with preview for better experience (previewing and applying)

* Support custom Ior exisitng) theme editing

* Add state colors and support showing/hiding optoinal colors

* Add "Copy all themes" menu item

* [ColorField] Support `hex` entry

* Register all themes (daisy + skeleton)

* Format files (fix lint error)

* Add changeset

* Version bump to 0.58.0-next.9

* Add ThemeSwitch to top-level exports

* pass through existing locale stores if they are passed into settings (#205)

* make DateField format and mask reactive to locale changes (#206)

* make DateField format and mask reactive to locale changes

* Make Input component reactive to changes in mask

* fix getPeriodTypeName calls (#207)

* [ColorField] Make color swatch look clickable

* [TableOfContents] Support changing icon

* [Popover|Menu|popover] Support `resize` width or height only

* [ThemeSelect] Improve width (consistent when switching between light/dark, and fix width on mobile)

* [MenuButton] Support hiding `menuIcon` and dispatch `change` event

* Collapse app header actions into menu on small viewports.  Resolves #185

* Small docs design refinements

* [LanguageSelect] Use code instead of flag for selection display

* Responsive tweaks

* Update examles to use `fill-light" instead of "fill" for default color buttons (after darkening "fill")

* Update all light/dark mode toggles to be light/dark (and not dark/light).  Update theme page to initialize/sync showDarkMode based on the current setting

* Feat/date range weekstarton (#208)

* add fr translation & use the "week" to fit the weekstartOn

* range & fr & reactivity

* adding more translation

* internal var name

* typeHelpers

* fix my typo 🙈

* Update localization settings and translations (#211)

* Increase the z-index of the docs header to fix some examples (ex. AppBar) stacking above

* Refine theme page layout

* Add `isolate` to `<main>` allow modals (Dialog, Drawer, etc) to stack above high z-index elements when portal'd to the bottom of the DOM (outside of `<main>`

* Version bump to 0.58.0-next.10

* Support passing a custom formatter function as `format` argument to format() / formatWithLocale()

* Version bump to 0.58.0-next.11

* Comment out `$env/dynamic/private` usage unti SvelteKit is upgraded to `2.3.2+` to fix Safari issue

* Restore using `$env/dynamic/private` (doesn't appear to solve Safari issue)

* update SvelteKit and Vite dependencies (#215)

* update SvelteKit and Vite dependencies

* move sveld back to deps

* Handle `weekInfo` across different browsers (fix Safari).  Closes #214

* Change PeriodType values (0 = unqualified DoW, 1-7 = Sun-Sat).  Fix DateRange bi-week periodType.  Add tests for `hasDayOfWeek()`, `getDayOfWeek()`, and `replaceDayOfWeek()` (#217)

* Version bump to 0.58.0-next.12

* Update all dependencies except vitest

* Remove typedoc (since not actively using)

* Format projecdt after updating prettier (fix lint errors)

* [DateRange] Update selection when only changing period type (from/to

* Add changeset

* Version bump to 0.58.0-next.13

* Run svelte-migrate for Kit v2 (#218)

* Upgrade vitest to 1.2 (#219)

* Replace `sveltePreprocess` with `vitePreprocess` in docs.  Closes #57

* Remove broken classname

* Use a separate settings() context on format() page to not try to update site context.  Fixes error when setting to anything other than `en` and `fr`

* Add `sumObjects` array util

* Add jsdoc

* Remove unused prop accessor arg

* Reduce the font size of the Tailwind typography/prose headers

* [Kbd] Set the text color

* Update Getting Started and Customization docs

* Fix ThemeSwitch SSR behavior by using `dark` class to define positioning and icon display (#228)

* Add TODOs

* Replace red/green with danger/success

* Fix overriding `elevation-#` classes. Add `elevation-none` to remove `elevation-#`.  Closes #233 (#236)

* [Appbar] Add `menuIcon` prop and slot.  Closes #235 (#239)

* [MultiSelect] Add `autoFocusSearch` to opt into functionality, which `MultiSelectMenu` maintains (#241)

* [DateRange] Remove `scrollIntoView` for date selection components (month, year) (#242)

* Add ability to set default props on some components (#230)

* Add defaultProps to settings, with labelPlacement setting

* Allow per-component defaults as well

* remove global default props

* Update docs and calls to settings

* alter getComponentSettings return to make it easier to combine with restProps

* udpate changeset

* clean up imports

* fixes

* format

* support `rounded` on Buttons

* Fix getComponentClasses() with string (root-only) classes. Ex. `AppBar: { classes: '...' }`

* Refine customization docs

* Remove types in lib/types/options.ts to libs/types/index.ts

* Support `size` and `color` default settings

* Proper use of resolveComponentClasses from both call sites

---------

Co-authored-by: Sean Lynch <techniq35@gmail.com>

* feat(DateField): Add support for `class` and `classes` props (#244)

* feat(DateField): Add support for `class` and `classes` props, add `DateField` class, pass `$$restProps`

* Remove unnecessary `NonNullable`

* Fix DateField example with locale dictionary

* Add default light/dark themes if none are provided

* Do not require defining `color-scheme` for light/dark mode (but still support being explicit)

* [ThemeSelect] Opt into adding keyboard shortcuts.  Also fixes double registration on customization page

* [DateField] Fix input value when clearing value

* Replace any `.` (index) imports

* Fix getting started tailwind plugin path

* Change layerchart version in template to `latest` version

---------

Co-authored-by: JYC <jycouet@gmail.com>
Co-authored-by: Daniel Imfeld <daniel@imfeld.dev>
Co-authored-by: Brandon McConnell <brandon@dreamthinkbuild.com>
@techniq techniq deleted the feat/formatDate branch March 22, 2024 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants