-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
chore(devenv): introduced parameterized demo HTML #579
chore(devenv): introduced parameterized demo HTML #579
Conversation
5dc31a6
to
274ab63
Compare
274ab63
to
c74e6a0
Compare
server.js
Outdated
@@ -26,7 +25,7 @@ app.use(webpackHotMiddleware(compiler)); | |||
|
|||
const fractal = Fractal.create(); | |||
fractal.components.set('path', path.join(__dirname, 'src/components')); | |||
fractal.components.set('ext', '.html'); | |||
fractal.components.set('ext', '.dust'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any way we could also support hbs
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fractal only allows on templating language
Going through this now, looks great 😄 Was curious about two things, namely:
|
@joshblack Yes for the former. As of now the template is built into HTML as the dist files. Direct consumption of templates is not covered in this PR as this PR focuses on "supporting multiple variants per template" scenario, but definitely in consideration - Along with design token stuff which I think we talked elsewhere in GH (but I cannot rattle off the link). |
5c7c995
to
6dabc3b
Compare
src/components/button/button.hbs
Outdated
@@ -0,0 +1,8 @@ | |||
<button class="bx--btn bx--btn--{{variant}}{{#if small}} bx--btn--sm{{/if}}" type="button">Button</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the variants (like small/big) just be separate hbs files?
I think Watson Health does component--variant.hbs
as the pattern
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joshblack Yes, that’s seen in tables in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW given you brought up separate files for variants - Wondering what you imagined using templates for? Text node values? Attributes? Repeat?
Was going through some of this now, noticed:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this get rid of the html
files completely? Just worried about the users that are depending on them as of now - the website is also using the html
files directly to show each component (although we are going to change this by v9). Could we surface both? If not, we'll have to have this in a separate v9 branch until the website is updated. Also not having the variations in separate files will potentially make it hard to show the different variations the way we do it right now on the website.
@joshblack I'm experiencing the same issues as you are |
Totally agreed that there should be some notion of the With respect to the different variants, I think Watson Health is doing:
So I think we could easily follow that model to allow multiple variants in one template file/demo. |
Right now we're just looking for the specific HTML files in |
I'm not sure what the idea is for the site looking forward, and this is totally outside the scope of this issue, but could be a good opportunity for a "to-be" scenario that introduces tabs to the top of the code snippets that let's you select a variant for how to use the component and copy the code for your use-case. e.g., tabs like HTML - Handlebars - React - Angular that someone could click and copy+paste. |
Yup, that's part of the plan for V9 (issue here https://github.ibm.com/Bluemix/carbon-issues/issues/451) 🙂 I just want to make sure that the website gets updated accordingly to any updates that happen here - removing the HTML files completely feels like a pretty drastic step. |
That's so exciting! |
Thanks @joshblack and @marijohannessen for jump in and discussing this thing! Wrt the HTML thing - Hope this clarifies the question regarding HTML. Please don’t hesitate to ping me either of you have any further questions/concerns. Thanks! P.S. Will take a look at the issue of viewport height. |
Addressed the viewport height concern: #603 |
6dabc3b
to
ab4938c
Compare
From the feedback from our devs, changed the target from |
ab4938c
to
a71db99
Compare
Review for v9 |
a71db99
to
9d5cc5f
Compare
9d5cc5f
to
844ba84
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks awesome! Nice work
Thanks everybody for reviewing!! |
* feat(inputs): fixed old pr and added inputs and colors work (#756) * feat(inputs): fixed old pr and added inputs and colors work * feat(inputs): fixed inline select * chore(devenv): introduced parameterized demo HTML (#579) * feat(code-snippet): Add new Code snippet variation and styles (#761) * feat(code-snippet): Update code snippet styles and names * feat(code-snippet): Update font size * chore: cleanup html files * feat(code-snippet): Update feedback copy tooltip to match new styles * chore: cleanup javascript * feat(code-snippet): Update copy tooltip styles * chore: cleanup js * feat(code-snippet): Update click event to only happen on button * chore: Add back support for deprecated class names * feat(code-snippet): Update tooltip styles and positioning * fix: update tooltip positioning for inline snippet * V9 merge 05162018 (#773) * fix(data-table-v2): fix the icon that becomes small when column header wraps, resolves #720 (#742) * fix(tooltip): Firefox overflowing text when you have a long enough string without spaces (#737) * feat(dropdown): added inline dropdown, style changes to dropdown, fixed link in data table readme (#746) * feat(dropdown): added inline dropdown * feat(dropdown): fixed js * docs(components): add component model explainer (#739) * fix(grid): center grid at largest breakpoint (#747) * fix(letter-spacing): Remove letter-spacing (#748) * fix(letter-spacing): remove letter-spacing across the board * fix(letter-spacing): change hard-coded letter-spacing values to use the mixin * fix(select): added disabled styling to option in select (#751) * fix(select): added disabled styling to select item * fix(select): removed disabled * fix(select): added cursor not allowed * fix(dropdown): added tabindex logic to dropdown (#749) * fix(input): remove red focus ring when input marked as required firefox (#750) * fix(multi-select): fixed width and hover color (#752) * feat(Skeleton-states): Add skeleton state styles (#713) * feat(skeleton): Add skeleton loading mixin and styles * feat(skeleton): Add skeleton icon styles * feat(skeleton): Add skeleton styles to components * feat(skeleton): Add structured list skeleton * feat: skeleton styles * feat: add skeleton demo html * feat: update skeleton html * feat(skeleton-states): Update accordion skeleton styles * feat(skeleton-states): Update accordion * chore: Update px to rem * chore: remove duplicate code * chore: Add correct color value for skeleton state * feat(skeleton-states): Update data table * fix(skeleton-states): Add helper-mixins import to components using skeleton states (#755) * fix(data-table): update data-table to use the new search component (#754) * fix(structured-list): Update header alignment to bottom to match designs (#753) * feat(truncation): add truncation classes (#757) * feat(truncation): add truncation classes * fix(truncation): update truncation classes to be more semantic * fix(truncation): use prefix variable * fix(structured-list): fixed column header text size (#766) * fix(structured-list): fixed column header text size * chore(structured-list): deleted extra file * fix(forms): Add helper-mixins import (#767) * fix(helper-classes): import vars file (#768) * fix(code-snippet): Update templates (#779) * fix(code-snippet): Update skeleton state styles * fix: swap code and pre tag nesting order * fix(code-snippet): Update hbs template for code snippet * fix: spelling error * chore: remove old files * chore: move changes from PR 774 to this * fix: Update click event to run on button * fix(pagination): bring v2 version back (#782) * chore(devenv): fix full-render demo (#783) * V9 merge 05182018 (#785) * feat(dropdown): added inline dropdown, style changes to dropdown, fixed link in data table readme (#746) * feat(dropdown): added inline dropdown * feat(dropdown): fixed js * fix(letter-spacing): Remove letter-spacing (#748) * fix(letter-spacing): remove letter-spacing across the board * fix(letter-spacing): change hard-coded letter-spacing values to use the mixin * fix(dropdown): added tabindex logic to dropdown (#749) * feat(Skeleton-states): Add skeleton state styles (#713) * feat(skeleton): Add skeleton loading mixin and styles * feat(skeleton): Add skeleton icon styles * feat(skeleton): Add skeleton styles to components * feat(skeleton): Add structured list skeleton * feat: skeleton styles * feat: add skeleton demo html * feat: update skeleton html * feat(skeleton-states): Update accordion skeleton styles * feat(skeleton-states): Update accordion * chore: Update px to rem * chore: remove duplicate code * chore: Add correct color value for skeleton state * feat(skeleton-states): Update data table * fix(font-face): bring missing $css--font-face reference back (#778) Fixes #777. * chore(devenv): update variant labels (#784) * chore(devenv): update variant labels * chore(devenv): modal config update * feat(tooltip): add definition tooltip (#714) * feat(tooltip): add definition tooltip * feat(tooltip): add on click tooltip * chore(tooltip): simple info tooltip * fix(tooltip): fix arrowhead 1 pixel * chore(tooltip): add v2 of tooltip in seperate folder * chore(tooltip): add previous version of tooltip * chore(tooltip): add files to globals * fix(tooltip): fix simple tooltip class name * chore(tooltip): add definition tooltip to readme * chore(tooltip): add tooltip icon * chore(tooltip): change definition tooltip to seperate element * fix(tooltip): fix merge conflict again * chore(tooltip): removed v2 and added new color variables * chore(tooltip): add bold modifier * chore(tooltip): updated migration to v9 and readme files * chore(tooltip): add focus to definition * chore(tooltip): remove tab * fix(tooltip): added accessibility aria tags * chore(tooltip): change arrow to be a dom element * chore(tooltip): change aria label location * chore(tooltip): attribute name change * chore(files): remove yarn-error.log (#800) * chore(package): remove npm5 lockfile and add lockfile to gitignore (#803) * V9 merge 05212018 (#801) * feat(dropdown): added inline dropdown, style changes to dropdown, fixed link in data table readme (#746) * feat(dropdown): added inline dropdown * feat(dropdown): fixed js * feat(Skeleton-states): Add skeleton state styles (#713) * feat(skeleton): Add skeleton loading mixin and styles * feat(skeleton): Add skeleton icon styles * feat(skeleton): Add skeleton styles to components * feat(skeleton): Add structured list skeleton * feat: skeleton styles * feat: add skeleton demo html * feat: update skeleton html * feat(skeleton-states): Update accordion skeleton styles * feat(skeleton-states): Update accordion * chore: Update px to rem * chore: remove duplicate code * chore: Add correct color value for skeleton state * feat(skeleton-states): Update data table * fix(tile): add check to make sure element exists (#786) * feat(data-table-v2): add inline edit styles for cell (#780) * fix(table): Missing border in firefox (#787) * fix(overflow-menu): added different styles for focus and hover (#788) * fix(overflow-menu): added different styles for focus and hover * fix(overflow-menu): fixed danger hover/focus * fix(data-table-v2): remove left positioning from sort icon (#789) * fix(tile): check if is--expanded is set when tile component is loaded (#791) * fix(danger-button): Add correct hover color for icon (#794) * fix(table): removes selected class from row on cancel click (#793) * chore(git): update gitignore for *.log files (#798) * fix(button): bring back primary danger button * chore(package): update lockfile to remove artifactory references (#808) * Light dropdown styles (#809) * feat(dropdown): Add light variation * feat(list-box): Add light variation * Icon updates (#810) * feat(icons): start updating icons * feat(icons): update more icons * feat(icons): continue icon work * feat(icons): finish up icon updates * fix(overflow): fix hover colors on overflow menu * fix(components): some small fixes for v9 (#812) * 732 search (#811) * chore(search): remove icons from search * fix(search): fix default close button offset * fix(form): fixed button width (#819) * fix(docs): Update Component docs (#815) * chore: Remove button docs ref glyphs * fix(docs): Update component docs * fix(code-snippet): fixed a render issue for the light version (#817) * feat(slider): Light variation (#818) * feat(slider): Add light variation * fix: Fix spelling error in all config files * feat(checkbox): Update checkboxes to match new icon set (#822) * feat(checkbox): Update checkboxes to match new icon set * feat: Update checkbox styles * fix: Add code snippet example skeleton state html (#827) * chore(tooltip): change to lowercase 'label' (#836) * fix(search): close button positioning for custom react search (#835) * fix(radio): Update radio + checkbox border colors (#834) * fix(radio-button): update border color * fix(checkbox): update checkbox colors * fix(icons): Update data table v2 & card icons (#826) * fix(icons): Update data table v2 & card icons * fix: Fix toolbar search icon from being cut off * fix(pagination): update colors (#832) * fix(multi-select): update hover color (#830) * fix(v9): small fixes to components (#838) * fix(v9): small fixes to components * fix(tooltip): align focus on icon with text * fix(multi-select): fix HTML structure of multi select (#840) * fix(pagination): fix text input position in pagination V1 (#841) * fix(tooltip): Definition tooltip positioning fix (#843) * fix(tooltip): update tooltip definition markup * fix: Add back in js positioning * chore: cleanup js comments * fix(tooltips: Tooltip a11y (#846) * fix(tooltip): update tooltip definition markup * fix(tooltip): top positioning * fix: A11y fixes * chore: update html/js/readme * chore: revert js changes. * fix(tooltip): position fix (#848) * fix(icons): update icons, other small fixes (#849) * fix(icons): update icons, other small fixes * fix(icon): add a w * fix(code-snippet): fixed feedback not showing up in firefox (#852) * chore: update dev env to work in IE11 (#853) * chore: remove deprecated components (#855) * fix(components): misc fixes for v9 (#854) * fix(inline-dropdown): removed box-shadow * fix(time-picker): fixed arrow being positioned weird in firefox * fix(code-snippet): banner showing up on ie11 * fix(form): remove margins from bx--form-item (#861) * fix(list-box): removed styles on disabled item (#862) * fix(select): position arrow based on bottom rather than top (#864) BREAKING CHANGE: update to v9
…-system#579) * fix(misc): misc fixes (carbon-design-system#530) * chore(lint): remove console.log from overflow * chore(build): remove node 4 from travis * chore(ButtonSet): mark as deprecated (carbon-design-system#510) Official carbon-components no longer need to use explicit containers for pairing button components. Buttons will space themselves when primary and secondary pairs are created. * fix(overflowmenu): cast to array to discard null children first * fix(overflow): those trailing commas
Overview
This PR switches component markup code from HTML to
DustHandlebars, allowing to generate HTML snippets for multiple variants easier, if differences in those variants are small.TODO:Try to align HTML file names to where they use to be, especially for major components that some projects may be using directlyUpdate tests to refer to the built version of the HTML snippetsAdded
component.config.js
, handling a subset of Fractal properties as follows:name
label
notes
context
preview
(Can be leftundefined
, if specified, should refer to aDustHandlebars template file name indemo/views
)Changed
DustHandlebarsDustHandlebars templateDustHandlebars rendering logic in itTesting / Reviewing
Starting with button for the review will be the easiest, to see how things work.
Testing should make sure dev env is not broken for any components, and also make sure HTML build is not broken.
Appendix
Current goal
Future goal (With separate PRs)
Non-goal