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

Polish Pass: Utility Features #922

Closed
54 tasks done
endigo9740 opened this issue Feb 3, 2023 · 17 comments · Fixed by #936 or #986
Closed
54 tasks done

Polish Pass: Utility Features #922

endigo9740 opened this issue Feb 3, 2023 · 17 comments · Fixed by #936 or #986
Assignees
Labels
enhancement New feature or request ready to test Ready to be tested for quality assurance.
Milestone

Comments

@endigo9740
Copy link
Contributor

endigo9740 commented Feb 3, 2023

Warning - changes prefaced with "BREAKING" indicate a breaking change.

Base on:

Goals

The goal of this pass will be to improve, refine, and finalize all Utility features in Skeleton.

  • Fix and address known issues and bugs
  • Refactor code, cleanup styles, and improve edge cases
  • Improve documentation for each feature
  • Expand with new features as relevant
  • Make overlays not suck, or at least suck less
  • Ensure Vitest test cases are passing
  • Resolve FIXME issues (reference)
  • Update all style props to use CssClasses type

Utiliies

Local Storage Stores

  • Update to the latest upstream version 0.40.0

Code Block

  • Minor visual refresh and code refactor
  • BREAKING: Property buttonCopy renamed button, default value is now variant-soft
  • Added buttonLabel and buttonCopied for basic i18n support
  • Added style props for blur and shadow
  • Prepare documentation "previewer" component

Drawers

  • Docs: make it clear these are a singleton
  • Greatly improved documentation and setup instructions
  • Provide advanced tip for animating background contents, per #637
  • Refactor of Drawer animation logic
  • Added shadow property for Drawer element
  • Added regionBackdrop|Drawer props. Available as overrides as well!
  • BREAKING: Removed drawer margin in favor of backdrop padding (provides better results)
  • Rounded corners by default, based on theme settings (set rounded-none to disable)

Lightswitch

Warning - BREAKING: this utility feature has been complete rebuilt from the ground up.

  • Lightswitch component rebuilt with new UI design and new props available
  • Now uses a service-like approach, per #737
  • Documented an alternative to the component if you wish to use OS preference automatically
  • Users can now interface with all LightSwitch methods, or build their own Lightswitch UI
  • Provided and documented interface stores, getters, and setter methods.

Modals

  • Docs: make it clear these are a singleton
  • Implement system to register and reuse custom modals, per #720
  • BREAKING: Custom modals are not styled by default to allow FULL customization
  • Allow prompt input to accept custom validation attributes, per #899
  • Added image modal example
  • Move modal example components to /docs - no longer part of the public package
  • Provided prop to set position - ex: top (search) or center (default), (reference)
  • Improve component scrolling, per #890

NOTE: we detailed a means to provide async modals here: #937

Toasts

  • Docs: make it clear these are a singleton
  • Add the selector class .toast-actions
  • The button type can now be changed through the button style props
  • Added new buttonDismissLabel prop to override the dismiss button label text
  • BREAKING: Replaced preset prop with background property allowing any variant or background class.
  • Improved transitions using Svelte Svelte FLIP animations
  • Added a callback function feature for the ToastSettings object

Popups

Warning - BREAKING: this completely replaces Menus and Tooltip utilities
This requires a new dependency: https://floating-ui.com/

  • Replaced Menus and Tooltips with new "Popup" utility feature
  • Fully documented, has tons of config options
  • Updated examples, including a functional Combobox
  • Has an open and close fade animation that can customized with CSS
  • Supports multiple interaction event handlers (click, hover, etc)
  • Can optionally include a customizable arrow on any variation
  • Now includes 12 position options
  • Dramatically better at keeping the popup on screen
  • Fully tree shakable
  • Allows you to modify a slew of settings through "middleware"
  • Supports a11y features, such as keyboard interaction
  • Introduced closeQuery setting, to selectively choose elements that close the popup (replaces interactive)

Menus

DEPRECATED: replaced with Popups (shown above). This feature has been completely removed.

Menus

DEPRECATED: replaced with Popups (shown above). This feature has been completely removed.

@endigo9740 endigo9740 self-assigned this Feb 3, 2023
@endigo9740 endigo9740 added the enhancement New feature or request label Feb 3, 2023
@endigo9740 endigo9740 pinned this issue Feb 3, 2023
@endigo9740 endigo9740 added this to the v1.0 milestone Feb 3, 2023
This was referenced Feb 4, 2023
@endigo9740 endigo9740 linked a pull request Feb 7, 2023 that will close this issue
@endigo9740
Copy link
Contributor Author

endigo9740 commented Feb 7, 2023

A new PR has been added, and you view a preview URL for the newest changes here:
https://skeleton-docs-git-chore-utilities-polish-pass-skeleton-labs.vercel.app/utilities/codeblocks

Per today's update I've updated the Local Storage Store to the latest upstream changes, as well as implemented some minor improvements to the Code Block component.

Additionally I've introduced a proof of concept "Previewer" component, which gives you an interactive canvas space for previewing components, their HTML/CSS/JS code, as well as some settings like viewport size and background color. I don't expect to implement this broadly yet, but you can see the proof of concept on the Code Blocks page. The examples at the top of the page use this.

Screenshot 2023-02-07 at 5 43 03 PM

@endigo9740
Copy link
Contributor Author

endigo9740 commented Feb 8, 2023

Preview URL:
https://skeleton-docs-git-chore-utilities-polish-pass-skeleton-labs.vercel.app/utilities/drawers

Today's updates have focused on Drawers, including a refactor to cleanup the animation logic, and a slew of new style properties. This should greatly expand the customization capabilities of this feature. Here's an example of a highly customized instance:

Screenshot 2023-02-08 at 4 57 02 PM

I've also added a subtle rounded effect to the Drawer element that matches theme settings and updates accordingly based on position:

Screenshot 2023-02-08 at 4 59 57 PM

Additionally I've research a means to animate the background content while the drawer is open. This will be best served as a feature users implement, as we cannot know what sort of layout structure they might be using.

Screenshot 2023-02-08 at 4 58 07 PM

I've provided more documentation about drawers using the Singleton pattern and what this means.

Finally, I've added a fixed note that we do not (and will not) support a means to disable the click-to-close backdrop feature. It's something we get regular requests for, so I want to make it clear it's against a11y best practices.

@Sarenor Sarenor mentioned this issue Feb 12, 2023
@endigo9740
Copy link
Contributor Author

The Lightswitch component has been completely rebuilt from the ground up. Preview it here:
https://skeleton-docs-git-chore-utilities-polish-pass-skeleton-labs.vercel.app/utilities/lightswitches

Screenshot 2023-02-12 at 3 57 01 PM

Notable changes:

  • New UI design that adheres to theme settings
  • A variety of new props, including a means to adjust the size
  • Underlaying logic completely rebuilt, abstracted to an external service
  • This service exposes the stores, getters, and setting methods for users
  • Users can utilize these to generate their own Lightswitch UI component
  • Also provided an alternative if you wish to use OS preference only

In a nutshell, the basic version is at simple as before, but now provide a ton of power-user features.

@endigo9740
Copy link
Contributor Author

endigo9740 commented Feb 13, 2023

We have a BIG series of modal updates today. These can be previewed here:
https://skeleton-docs-git-chore-utilities-polish-pass-skeleton-labs.vercel.app/utilities/modals

Screenshot 2023-02-13 at 5 06 57 PM

Notable changes:

  • You can now optionally register components on the parent <Modal> for easy reuse.
  • Custom modals are no longer styled by default, giving you complete control over design
  • ModalSettings now allows for valueAttr to define the prompt input type and other attributes
  • Transition duration, x, y, and opacity settings are now exposed a props.
  • I've added a new example modal, which displays a single image with a detached close button.
  • You can now easily set the modal vertical position either globally or per instance.
  • The backdrop region now support vertical scroll for tall components.
  • Added a canned set of utility classes to control modal width, such as .w-modal.

Here's what it looks like to register a set of components in the root layout:

image

image

Here's the reduction in code for our doc search modal using the above techniques:

image

That said, I do still have one more item I would like to address, which is making modals async by default, per #937

@endigo9740
Copy link
Contributor Author

Several notable updates to the Toast utility today. You can preview this here:
https://skeleton-docs-git-chore-utilities-polish-pass-skeleton-labs.vercel.app/utilities/toasts

Screenshot 2023-02-14 at 1 41 41 PM

  • Minor UI adjustments
  • Various new or updates prop values, including the ability to customize the dismiss button text
  • Replaced the preset prop with a background prop which can take utility classes or variants
  • Improved the animation, especially when multiple are queued

@Hugos68
Copy link
Contributor

Hugos68 commented Feb 14, 2023

  • All visible toasts will slighly bump up a tiny amount after every toast that is triggered when the visible limit of 3 is full.

@endigo9740
Copy link
Contributor Author

endigo9740 commented Feb 15, 2023

Big update today - both Menus and Tooltips have now been replaced with the new "Popups" feature:
https://skeleton-docs-git-chore-utilities-polish-pass-skeleton-labs.vercel.app/utilities/popups

popups.mp4

This includes a new dependency called Floating UI (previously known as Popper.js):
https://floating-ui.com/

Notable improvements:

  • Fully documented, has tons of config options
  • Updated examples, including a functional Combobox
  • Includes a fade animation on open/close
  • Supports multiple interaction event handlers (click, hover, both)
  • Can optionally include a customizable arrow on any variation
  • Now includes 12 position options
  • Dramatically better performance in keeping the popup on screen
  • Fully tree shakable
  • Allows you to modify a host of settings through "middleware"

@ryceg
Copy link
Contributor

ryceg commented Feb 15, 2023

  • Minor quibble: you use the error token for the "advanced" tag, and should be using the error token.

@niktek
Copy link
Contributor

niktek commented Feb 15, 2023

  • combobox opens once on iOS and not at all on Android

@AdrianGonz97
Copy link
Member

AdrianGonz97 commented Feb 15, 2023

  • Share the open/close state of the popup, similar to how we currently do it for menus.
  • Bug where if you click on the "Menu" button twice, any outside clicks won't close the popup. The button needs to be clicked again for outside clicks to close it.
  • The options in the select box in Code Blocks is using gray text on a white background. This is the case on all browsers except Safari since I can't test it.
    img

@endigo9740
Copy link
Contributor Author

endigo9740 commented Feb 15, 2023

Popup QA feedback:

  • Include the type import for doc shell settings
  • Include the params data for the doc shell settings
  • Include the CSS class names for the doc shell settings
  • Mention that Floating UI popups have a fighting z-index issue when overlaying elements using backdrop-blur (at least on Chrome). It's most likely a browser bug.
  • Implement keyboard interaction, such as ESC to close.
  • Add popup and the PopupSettings type to index.ts package exports

@endigo9740
Copy link
Contributor Author

endigo9740 commented Feb 16, 2023

Reminder:

@JustBarnt
Copy link
Contributor

JustBarnt commented Feb 16, 2023

  • Toast - Implement functionality below to allow Toasts to trigger a callback when it is created and closed.

  • So when the ID is assigned -> trigger the callback with id: whatever and status: assigned as the response

  • When the toast is closed -> we trigger it again, but this time change status: closed

The callback function would then look for a status of "assigned" or "closed" to fire the appropriate event.

@endigo9740 endigo9740 added the ready to test Ready to be tested for quality assurance. label Feb 16, 2023
@endigo9740
Copy link
Contributor Author

FYI this has been merged into dev branch, please continue QA testing there!
https://dev.skeleton.dev/

@endigo9740 endigo9740 reopened this Feb 16, 2023
@SebasF1349
Copy link
Member

SebasF1349 commented Feb 17, 2023

  • Code Blocks: First example (at the very top) shows <div>This is meta</div> in the code but <p>Hello Skeleton<p> in the preview.
  • Modals: undefined class
    msedgewebview2_xNkQxBRusk
  • Toasts: After spamming toasts and closing them I keep getting this error (it works btw)
    brave_LFG9IUOmWN

@endigo9740
Copy link
Contributor Author

endigo9740 commented Feb 17, 2023

Per Popups

  • We need to implement the interactive mode option to allow popups to close when interaction or route change occurs.

@endigo9740
Copy link
Contributor Author

endigo9740 commented Feb 19, 2023

I've implement a new queryClose setting for popups that allow you to set the list of the popup's child elements that will close the popup when clicked. By default any anchor or button clicked within the popup will automatically close it, but this can be easily overwritten.

Screenshot 2023-02-19 at 3 24 39 PM

@endigo9740 endigo9740 unpinned this issue Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ready to test Ready to be tested for quality assurance.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants