@triptease/design-system-mcp 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +653 -323
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -23302,7 +23302,7 @@ var StdioServerTransport = class {
|
|
|
23302
23302
|
// package.json
|
|
23303
23303
|
var package_default = {
|
|
23304
23304
|
name: "@triptease/design-system-mcp",
|
|
23305
|
-
version: "1.2.
|
|
23305
|
+
version: "1.2.3",
|
|
23306
23306
|
description: "MCP server for Triptease design system documentation",
|
|
23307
23307
|
type: "module",
|
|
23308
23308
|
main: "dist/index.js",
|
|
@@ -23409,7 +23409,74 @@ var button_default = {
|
|
|
23409
23409
|
examples: [
|
|
23410
23410
|
{
|
|
23411
23411
|
title: "Basic usage",
|
|
23412
|
-
code: `<button>
|
|
23412
|
+
code: `<button>Save Changes</button>`
|
|
23413
|
+
},
|
|
23414
|
+
{
|
|
23415
|
+
title: "Primary",
|
|
23416
|
+
description: "Use the primary theme for the single most important action on the page.",
|
|
23417
|
+
code: `<button data-theme="primary">Save Changes</button>`
|
|
23418
|
+
},
|
|
23419
|
+
{
|
|
23420
|
+
title: "Secondary",
|
|
23421
|
+
description: "Use the secondary theme for supporting actions that sit alongside a primary action.",
|
|
23422
|
+
code: `<button data-theme="secondary">Save Changes</button>`
|
|
23423
|
+
},
|
|
23424
|
+
{
|
|
23425
|
+
title: "Tertiary",
|
|
23426
|
+
description: "Use the tertiary theme for low-emphasis actions that should not compete with primary or secondary buttons.",
|
|
23427
|
+
code: `<button data-theme="tertiary">Save Changes</button>`
|
|
23428
|
+
},
|
|
23429
|
+
{
|
|
23430
|
+
title: "Destructive primary",
|
|
23431
|
+
description: "Use the destructive primary theme for irreversible actions such as deleting a booking or removing a channel.",
|
|
23432
|
+
code: `<button data-theme="destructive-primary">Save Changes</button>`
|
|
23433
|
+
},
|
|
23434
|
+
{
|
|
23435
|
+
title: "Destructive secondary",
|
|
23436
|
+
description: "Use the destructive secondary theme for a less prominent destructive action alongside other actions.",
|
|
23437
|
+
code: `<button data-theme="destructive-secondary">Save Changes</button>`
|
|
23438
|
+
},
|
|
23439
|
+
{
|
|
23440
|
+
title: "Destructive tertiary",
|
|
23441
|
+
description: "Use the destructive tertiary theme for a low-emphasis destructive action that should not draw immediate attention.",
|
|
23442
|
+
code: `<button data-theme="destructive-tertiary">Save Changes</button>`
|
|
23443
|
+
},
|
|
23444
|
+
{
|
|
23445
|
+
title: "Inline",
|
|
23446
|
+
description: "Use the inline theme for actions embedded within body text or constrained layout areas.",
|
|
23447
|
+
code: `<button data-theme="inline">Save Changes</button>`
|
|
23448
|
+
},
|
|
23449
|
+
{
|
|
23450
|
+
title: "Suggestion",
|
|
23451
|
+
description: "Use the suggestion theme for recommended or auto-generated actions that users can accept or dismiss.",
|
|
23452
|
+
code: `<button data-theme="suggestion">Save Changes</button>`
|
|
23453
|
+
},
|
|
23454
|
+
{
|
|
23455
|
+
title: "Small",
|
|
23456
|
+
description: "Use the small size for buttons in compact layouts such as table rows or dense toolbars.",
|
|
23457
|
+
code: `<button data-theme="primary" class="small">Save Changes</button>`
|
|
23458
|
+
},
|
|
23459
|
+
{
|
|
23460
|
+
title: "Large",
|
|
23461
|
+
description: "Use the large size for high-prominence call-to-action areas where the action needs to stand out, such as a campaign setup or onboarding step.",
|
|
23462
|
+
code: `<button data-theme="primary" class="large">Save Changes</button>`
|
|
23463
|
+
},
|
|
23464
|
+
{
|
|
23465
|
+
title: "Loading",
|
|
23466
|
+
description: "Use the loading state while an action is in progress, such as submitting a booking or saving rate changes.",
|
|
23467
|
+
code: `<button data-theme="primary" data-loading aria-busy>Save Changes</button>`
|
|
23468
|
+
},
|
|
23469
|
+
{
|
|
23470
|
+
title: "Disabled",
|
|
23471
|
+
description: "Use the disabled state when an action is temporarily unavailable, such as when required form fields are incomplete. If a user will never be able to perform this action based on their role or permissions, hide it entirely rather than showing it as disabled.",
|
|
23472
|
+
code: `<button data-theme="primary" disabled aria-disabled>Save Changes</button>`
|
|
23473
|
+
},
|
|
23474
|
+
{
|
|
23475
|
+
title: "Icon button",
|
|
23476
|
+
description: "Use buttons with icons to provide visual context. If you do not provide a size to tt-icon, it will inherit the size of the button.",
|
|
23477
|
+
code: `<button data-theme="primary">
|
|
23478
|
+
<tt-icon name="download"></tt-icon> Download
|
|
23479
|
+
</button>`
|
|
23413
23480
|
}
|
|
23414
23481
|
]
|
|
23415
23482
|
}
|
|
@@ -23459,11 +23526,22 @@ var textinput_default = {
|
|
|
23459
23526
|
<input id="hotel-name" />`
|
|
23460
23527
|
},
|
|
23461
23528
|
{
|
|
23462
|
-
title: "
|
|
23463
|
-
description: "Use
|
|
23464
|
-
code: `<label for="
|
|
23465
|
-
<input id="
|
|
23466
|
-
|
|
23529
|
+
title: "Disabled",
|
|
23530
|
+
description: "Use the disabled state when the field is temporarily not editable in the current context, such as a read-only booking reference. If the field will never be editable for this user based on their role or permissions, hide it entirely rather than showing it as disabled.",
|
|
23531
|
+
code: `<label for="booking-ref">Booking Reference</label>
|
|
23532
|
+
<input id="booking-ref" value="TT-2025-04821" disabled />`
|
|
23533
|
+
},
|
|
23534
|
+
{
|
|
23535
|
+
title: "Placeholder",
|
|
23536
|
+
description: "Use placeholder text to provide a short example of the expected input format \u2014 do not use it as a substitute for a label.",
|
|
23537
|
+
code: `<label for="hotel-name">Hotel Name</label>
|
|
23538
|
+
<input id="hotel-name" placeholder="Triptease" />`
|
|
23539
|
+
},
|
|
23540
|
+
{
|
|
23541
|
+
title: "Invalid",
|
|
23542
|
+
description: "Use the invalid state when the field value fails validation, such as a missing required hotel name.",
|
|
23543
|
+
code: `<label for="hotel-name">Hotel Name</label>
|
|
23544
|
+
<input id="hotel-name" aria-invalid />`
|
|
23467
23545
|
}
|
|
23468
23546
|
]
|
|
23469
23547
|
}
|
|
@@ -23524,11 +23602,22 @@ var numberinput_default = {
|
|
|
23524
23602
|
<input id="hotel-count" type="number" />`
|
|
23525
23603
|
},
|
|
23526
23604
|
{
|
|
23527
|
-
title: "
|
|
23528
|
-
description: "Use
|
|
23529
|
-
code: `<label for="
|
|
23530
|
-
<input id="
|
|
23531
|
-
|
|
23605
|
+
title: "Disabled",
|
|
23606
|
+
description: "Use the disabled state when the field is temporarily not editable, such as a locked room count during an active booking period. If the field will never be editable for this user based on their role or permissions, hide it entirely rather than showing it as disabled.",
|
|
23607
|
+
code: `<label for="room-count">Room Count</label>
|
|
23608
|
+
<input id="room-count" type="number" value="42" disabled />`
|
|
23609
|
+
},
|
|
23610
|
+
{
|
|
23611
|
+
title: "Placeholder",
|
|
23612
|
+
description: "Use placeholder text to show an example of the expected value format \u2014 do not use it as a substitute for a label.",
|
|
23613
|
+
code: `<label for="hotel-count">Number of Hotels</label>
|
|
23614
|
+
<input id="hotel-count" type="number" placeholder="1234" />`
|
|
23615
|
+
},
|
|
23616
|
+
{
|
|
23617
|
+
title: "Invalid",
|
|
23618
|
+
description: "Use the invalid state when the entered value is out of an acceptable range or otherwise fails validation.",
|
|
23619
|
+
code: `<label for="hotel-count">Number of Hotels</label>
|
|
23620
|
+
<input id="hotel-count" type="number" aria-invalid />`
|
|
23532
23621
|
}
|
|
23533
23622
|
]
|
|
23534
23623
|
}
|
|
@@ -23579,11 +23668,22 @@ var textarea_default = {
|
|
|
23579
23668
|
<textarea id="about" rows="4"></textarea>`
|
|
23580
23669
|
},
|
|
23581
23670
|
{
|
|
23582
|
-
title: "
|
|
23583
|
-
description: "Use
|
|
23584
|
-
code: `<label for="
|
|
23585
|
-
<textarea id="
|
|
23586
|
-
|
|
23671
|
+
title: "Disabled",
|
|
23672
|
+
description: "Use the disabled state when the field is temporarily not editable in the current context, such as a locked guest notes field. If the field will never be editable for this user based on their role or permissions, hide it entirely rather than showing it as disabled.",
|
|
23673
|
+
code: `<label for="guest-notes">Guest Notes</label>
|
|
23674
|
+
<textarea id="guest-notes" rows="4" disabled></textarea>`
|
|
23675
|
+
},
|
|
23676
|
+
{
|
|
23677
|
+
title: "Placeholder",
|
|
23678
|
+
description: "Use placeholder text to hint at the expected content format \u2014 do not use it as a substitute for a label.",
|
|
23679
|
+
code: `<label for="about">About</label>
|
|
23680
|
+
<textarea id="about" rows="4" placeholder="My hotel is the best hotel in the world!"></textarea>`
|
|
23681
|
+
},
|
|
23682
|
+
{
|
|
23683
|
+
title: "Invalid",
|
|
23684
|
+
description: "Use the invalid state when the field value fails validation, such as a required description that has been left empty.",
|
|
23685
|
+
code: `<label for="about">About</label>
|
|
23686
|
+
<textarea id="about" rows="4" aria-invalid></textarea>`
|
|
23587
23687
|
}
|
|
23588
23688
|
]
|
|
23589
23689
|
}
|
|
@@ -23601,9 +23701,9 @@ var select_default = {
|
|
|
23601
23701
|
},
|
|
23602
23702
|
examples: [
|
|
23603
23703
|
{
|
|
23604
|
-
title: "Basic
|
|
23704
|
+
title: "Basic usage",
|
|
23605
23705
|
code: `<label for="reports">Select report frequency</label>
|
|
23606
|
-
<select name="reports">
|
|
23706
|
+
<select id="reports" name="reports">
|
|
23607
23707
|
<option value="daily">Daily Report</option>
|
|
23608
23708
|
<option value="weekly">Weekly Report</option>
|
|
23609
23709
|
<option value="monthly">Monthly Report</option>
|
|
@@ -23648,30 +23748,55 @@ var checkbox_default = {
|
|
|
23648
23748
|
},
|
|
23649
23749
|
examples: [
|
|
23650
23750
|
{
|
|
23651
|
-
title: "
|
|
23652
|
-
|
|
23751
|
+
title: "Basic usage",
|
|
23752
|
+
code: `<fieldset>
|
|
23753
|
+
<legend>Select notification types:</legend>
|
|
23754
|
+
<input type="checkbox" id="checkbox-booking" name="notification" value="booking-confirmations" />
|
|
23755
|
+
<label for="checkbox-booking">Booking Confirmations</label>
|
|
23756
|
+
<input type="checkbox" id="checkbox-price" name="notification" value="price-alerts" />
|
|
23757
|
+
<label for="checkbox-price">Price Alerts</label>
|
|
23758
|
+
<input type="checkbox" id="checkbox-occupancy" name="notification" value="occupancy-reports" />
|
|
23759
|
+
<label for="checkbox-occupancy">Occupancy Reports</label>
|
|
23760
|
+
</fieldset>`
|
|
23761
|
+
},
|
|
23762
|
+
{
|
|
23763
|
+
title: "Disabled all",
|
|
23764
|
+
description: "Use the disabled fieldset when the entire group of options is temporarily unavailable for selection. If the options will never be available to this user based on their role or permissions, hide the group entirely rather than showing it as disabled.",
|
|
23765
|
+
code: `<fieldset disabled>
|
|
23766
|
+
<legend>Select notification types:</legend>
|
|
23767
|
+
<input type="checkbox" id="checkbox-booking" name="notification" value="booking-confirmations" />
|
|
23768
|
+
<label for="checkbox-booking">Booking Confirmations</label>
|
|
23769
|
+
<input type="checkbox" id="checkbox-price" name="notification" value="price-alerts" />
|
|
23770
|
+
<label for="checkbox-price">Price Alerts</label>
|
|
23771
|
+
<input type="checkbox" id="checkbox-occupancy" name="notification" value="occupancy-reports" />
|
|
23772
|
+
<label for="checkbox-occupancy">Occupancy Reports</label>
|
|
23773
|
+
</fieldset>`
|
|
23774
|
+
},
|
|
23775
|
+
{
|
|
23776
|
+
title: "Disabled single",
|
|
23777
|
+
description: "Use a disabled individual checkbox when a specific option is temporarily unavailable while the rest of the group remains selectable. If the option will never be available to this user based on their role or permissions, hide it entirely rather than showing it as disabled.",
|
|
23653
23778
|
code: `<fieldset>
|
|
23654
|
-
<legend>
|
|
23655
|
-
<input type="checkbox" id="checkbox-
|
|
23656
|
-
<label for="checkbox-
|
|
23657
|
-
<input type="checkbox" id="checkbox-
|
|
23658
|
-
<label for="checkbox-
|
|
23659
|
-
<input type="checkbox" id="checkbox-
|
|
23660
|
-
<label for="checkbox-
|
|
23779
|
+
<legend>Select notification types:</legend>
|
|
23780
|
+
<input type="checkbox" id="checkbox-booking" name="notification" value="booking-confirmations" disabled />
|
|
23781
|
+
<label for="checkbox-booking">Booking Confirmations</label>
|
|
23782
|
+
<input type="checkbox" id="checkbox-price" name="notification" value="price-alerts" />
|
|
23783
|
+
<label for="checkbox-price">Price Alerts</label>
|
|
23784
|
+
<input type="checkbox" id="checkbox-occupancy" name="notification" value="occupancy-reports" />
|
|
23785
|
+
<label for="checkbox-occupancy">Occupancy Reports</label>
|
|
23661
23786
|
</fieldset>`
|
|
23662
23787
|
},
|
|
23663
23788
|
{
|
|
23664
23789
|
title: "Error state",
|
|
23665
|
-
description: "Use
|
|
23790
|
+
description: "Use the error state when required checkboxes are not selected, such as when a user submits a form without making a selection. Always pair error indicators with a visible, descriptive error message.",
|
|
23666
23791
|
code: `<fieldset>
|
|
23667
|
-
<legend>
|
|
23668
|
-
<input type="checkbox" id="checkbox-
|
|
23669
|
-
<label for="checkbox-
|
|
23670
|
-
<input type="checkbox" id="checkbox-
|
|
23671
|
-
<label for="checkbox-
|
|
23672
|
-
<input type="checkbox" id="checkbox-
|
|
23673
|
-
<label for="checkbox-
|
|
23674
|
-
<p id="
|
|
23792
|
+
<legend>Select notification types:</legend>
|
|
23793
|
+
<input type="checkbox" id="checkbox-booking" name="notification" value="booking-confirmations" aria-invalid aria-describedby="notification-error-message" />
|
|
23794
|
+
<label for="checkbox-booking">Booking Confirmations</label>
|
|
23795
|
+
<input type="checkbox" id="checkbox-price" name="notification" value="price-alerts" aria-invalid aria-describedby="notification-error-message" />
|
|
23796
|
+
<label for="checkbox-price">Price Alerts</label>
|
|
23797
|
+
<input type="checkbox" id="checkbox-occupancy" name="notification" value="occupancy-reports" aria-invalid aria-describedby="notification-error-message" />
|
|
23798
|
+
<label for="checkbox-occupancy">Occupancy Reports</label>
|
|
23799
|
+
<p id="notification-error-message" class="text-error">Required</p>
|
|
23675
23800
|
</fieldset>`
|
|
23676
23801
|
}
|
|
23677
23802
|
]
|
|
@@ -23713,16 +23838,41 @@ var radio_default = {
|
|
|
23713
23838
|
},
|
|
23714
23839
|
examples: [
|
|
23715
23840
|
{
|
|
23716
|
-
title: "
|
|
23717
|
-
|
|
23841
|
+
title: "Basic usage",
|
|
23842
|
+
code: `<fieldset>
|
|
23843
|
+
<legend>Select rate plan:</legend>
|
|
23844
|
+
<input type="radio" id="radio-bar" name="rate-plan" value="best-available-rate" />
|
|
23845
|
+
<label for="radio-bar">Best Available Rate</label>
|
|
23846
|
+
<input type="radio" id="radio-non-refundable" name="rate-plan" value="non-refundable-rate" />
|
|
23847
|
+
<label for="radio-non-refundable">Non-refundable Rate</label>
|
|
23848
|
+
<input type="radio" id="radio-member" name="rate-plan" value="member-rate" />
|
|
23849
|
+
<label for="radio-member">Member Rate</label>
|
|
23850
|
+
</fieldset>`
|
|
23851
|
+
},
|
|
23852
|
+
{
|
|
23853
|
+
title: "Disabled all",
|
|
23854
|
+
description: "Use the disabled fieldset when the entire selection group is temporarily unavailable for interaction. If the options will never be available to this user based on their role or permissions, hide the group entirely rather than showing it as disabled.",
|
|
23855
|
+
code: `<fieldset disabled>
|
|
23856
|
+
<legend>Select rate plan:</legend>
|
|
23857
|
+
<input type="radio" id="radio-bar" name="rate-plan" value="best-available-rate" />
|
|
23858
|
+
<label for="radio-bar">Best Available Rate</label>
|
|
23859
|
+
<input type="radio" id="radio-non-refundable" name="rate-plan" value="non-refundable-rate" />
|
|
23860
|
+
<label for="radio-non-refundable">Non-refundable Rate</label>
|
|
23861
|
+
<input type="radio" id="radio-member" name="rate-plan" value="member-rate" />
|
|
23862
|
+
<label for="radio-member">Member Rate</label>
|
|
23863
|
+
</fieldset>`
|
|
23864
|
+
},
|
|
23865
|
+
{
|
|
23866
|
+
title: "Disabled single",
|
|
23867
|
+
description: "Use a disabled individual radio option when a specific choice is temporarily unavailable while the rest of the group remains selectable. If the option will never be available to this user based on their role or permissions, hide it entirely rather than showing it as disabled.",
|
|
23718
23868
|
code: `<fieldset>
|
|
23719
|
-
<legend>
|
|
23720
|
-
<input type="radio" id="radio-
|
|
23721
|
-
<label for="radio-
|
|
23722
|
-
<input type="radio" id="radio-
|
|
23723
|
-
<label for="radio-
|
|
23724
|
-
<input type="radio" id="radio-
|
|
23725
|
-
<label for="radio-
|
|
23869
|
+
<legend>Select rate plan:</legend>
|
|
23870
|
+
<input type="radio" id="radio-bar" name="rate-plan" value="best-available-rate" disabled />
|
|
23871
|
+
<label for="radio-bar">Best Available Rate</label>
|
|
23872
|
+
<input type="radio" id="radio-non-refundable" name="rate-plan" value="non-refundable-rate" />
|
|
23873
|
+
<label for="radio-non-refundable">Non-refundable Rate</label>
|
|
23874
|
+
<input type="radio" id="radio-member" name="rate-plan" value="member-rate" />
|
|
23875
|
+
<label for="radio-member">Member Rate</label>
|
|
23726
23876
|
</fieldset>`
|
|
23727
23877
|
}
|
|
23728
23878
|
]
|
|
@@ -23752,7 +23902,7 @@ var toggle_default = {
|
|
|
23752
23902
|
},
|
|
23753
23903
|
examples: [
|
|
23754
23904
|
{
|
|
23755
|
-
title: "
|
|
23905
|
+
title: "Basic usage",
|
|
23756
23906
|
code: `<input type="checkbox" id="weekly-parity-report" data-theme="toggle" />
|
|
23757
23907
|
<label for="weekly-parity-report">Weekly Parity Report</label>`
|
|
23758
23908
|
}
|
|
@@ -23791,14 +23941,38 @@ var badge_default = {
|
|
|
23791
23941
|
},
|
|
23792
23942
|
examples: [
|
|
23793
23943
|
{
|
|
23794
|
-
title: "
|
|
23795
|
-
|
|
23796
|
-
|
|
23797
|
-
|
|
23798
|
-
|
|
23799
|
-
|
|
23800
|
-
|
|
23801
|
-
|
|
23944
|
+
title: "Basic usage",
|
|
23945
|
+
code: `<span class="badge">New</span>`
|
|
23946
|
+
},
|
|
23947
|
+
{
|
|
23948
|
+
title: "Subtle",
|
|
23949
|
+
description: "Use the subtle theme for low-priority labels that need to be visible without drawing strong attention.",
|
|
23950
|
+
code: `<span class="badge" data-theme="subtle">Draft</span>`
|
|
23951
|
+
},
|
|
23952
|
+
{
|
|
23953
|
+
title: "Danger",
|
|
23954
|
+
description: "Use the danger theme to signal a critical issue or error state, such as a booking failure or rate parity alert.",
|
|
23955
|
+
code: `<span class="badge" data-theme="danger">Failed</span>`
|
|
23956
|
+
},
|
|
23957
|
+
{
|
|
23958
|
+
title: "Success",
|
|
23959
|
+
description: "Use the success theme to confirm a positive outcome, such as a completed booking or a healthy occupancy rate.",
|
|
23960
|
+
code: `<span class="badge" data-theme="success">Active</span>`
|
|
23961
|
+
},
|
|
23962
|
+
{
|
|
23963
|
+
title: "Warning",
|
|
23964
|
+
description: "Use the warning theme to flag a condition that may need attention, such as low room availability or a pending review.",
|
|
23965
|
+
code: `<span class="badge" data-theme="warning">Pending</span>`
|
|
23966
|
+
},
|
|
23967
|
+
{
|
|
23968
|
+
title: "Info",
|
|
23969
|
+
description: "Use the info theme for neutral informational labels, such as a channel name or a rate plan type.",
|
|
23970
|
+
code: `<span class="badge" data-theme="info">Metasearch</span>`
|
|
23971
|
+
},
|
|
23972
|
+
{
|
|
23973
|
+
title: "Primary",
|
|
23974
|
+
description: "Use the primary theme to draw attention to a key label, such as a promoted rate or a featured channel.",
|
|
23975
|
+
code: `<span class="badge" data-theme="primary">Featured</span>`
|
|
23802
23976
|
}
|
|
23803
23977
|
]
|
|
23804
23978
|
}
|
|
@@ -23829,18 +24003,11 @@ var card_default = {
|
|
|
23829
24003
|
},
|
|
23830
24004
|
examples: [
|
|
23831
24005
|
{
|
|
23832
|
-
title: "Basic
|
|
24006
|
+
title: "Basic usage",
|
|
23833
24007
|
code: `<div class="card">
|
|
23834
|
-
<h3>
|
|
23835
|
-
<p>
|
|
23836
|
-
</
|
|
23837
|
-
},
|
|
23838
|
-
{
|
|
23839
|
-
title: "Card with custom padding",
|
|
23840
|
-
description: "Customize using --card-padding or --card-vertical-spacing CSS variables",
|
|
23841
|
-
code: `<div class="card" style="--card-padding: var(--space-scale-4)">
|
|
23842
|
-
<h3>Card with more padding</h3>
|
|
23843
|
-
<p>Customized via CSS variable instead of writing custom CSS</p>
|
|
24008
|
+
<h3>Boost low-occupancy dates</h3>
|
|
24009
|
+
<p>Drive bookings when you need them most</p>
|
|
24010
|
+
<button data-theme="secondary">Boost some dates</button>
|
|
23844
24011
|
</div>`
|
|
23845
24012
|
}
|
|
23846
24013
|
]
|
|
@@ -24059,7 +24226,7 @@ var typography_default = {
|
|
|
24059
24226
|
"Use semantic elements (h1-h4, strong, a) for document structure and accessibility",
|
|
24060
24227
|
"Use utility classes (.heading-1 through .heading-4, .display, .body, .small, .strong, .text-error) when visual styling must differ from semantic meaning",
|
|
24061
24228
|
"Follow heading hierarchy - don't skip levels (h1 \u2192 h2 \u2192 h3, not h1 \u2192 h3)",
|
|
24062
|
-
"Use
|
|
24229
|
+
"Use strong for semantic importance, .strong for visual styling only"
|
|
24063
24230
|
],
|
|
24064
24231
|
avoid: [
|
|
24065
24232
|
"Using heading classes for document structure (use semantic h1-h4 elements)",
|
|
@@ -24077,7 +24244,33 @@ var typography_default = {
|
|
|
24077
24244
|
strong: "Bold text styling without semantic importance",
|
|
24078
24245
|
small: "Smaller text for captions, helper text, fine print",
|
|
24079
24246
|
"text-error": "Error text color for validation messages"
|
|
24080
|
-
}
|
|
24247
|
+
},
|
|
24248
|
+
examples: [
|
|
24249
|
+
{
|
|
24250
|
+
title: "Semantic elements",
|
|
24251
|
+
description: "Use semantic heading elements for document structure, screen reader navigation, and SEO \u2014 independent of how they look visually.",
|
|
24252
|
+
code: `<h1>Page title</h1>
|
|
24253
|
+
<h2>Section heading</h2>
|
|
24254
|
+
<h3>Subsection heading</h3>
|
|
24255
|
+
<h4>Detail heading</h4>
|
|
24256
|
+
<p>Body text</p>
|
|
24257
|
+
<strong>Important text</strong>
|
|
24258
|
+
<a href="#">Link text</a>`
|
|
24259
|
+
},
|
|
24260
|
+
{
|
|
24261
|
+
title: "Class-based typography",
|
|
24262
|
+
description: "Use class-based typography when the visual style needs to differ from the semantic heading level \u2014 for example, a visually large label on a section that is not a document heading.",
|
|
24263
|
+
code: `<p class="display">Display</p>
|
|
24264
|
+
<p class="heading-1">Heading 1</p>
|
|
24265
|
+
<p class="heading-2">Heading 2</p>
|
|
24266
|
+
<p class="heading-3">Heading 3</p>
|
|
24267
|
+
<p class="heading-4">Heading 4</p>
|
|
24268
|
+
<p class="body">Body</p>
|
|
24269
|
+
<p class="strong">Strong</p>
|
|
24270
|
+
<p class="small">Small</p>
|
|
24271
|
+
<p class="text-error">Error text</p>`
|
|
24272
|
+
}
|
|
24273
|
+
]
|
|
24081
24274
|
}
|
|
24082
24275
|
};
|
|
24083
24276
|
|
|
@@ -24136,7 +24329,7 @@ var dialog_default = {
|
|
|
24136
24329
|
},
|
|
24137
24330
|
{
|
|
24138
24331
|
title: "With CSS custom properties",
|
|
24139
|
-
description: "Use CSS custom properties to customize dialog positioning
|
|
24332
|
+
description: "Use CSS custom properties to customize dialog positioning. --dialog-left-distance controls the horizontal position of the dialog.",
|
|
24140
24333
|
code: `<button data-theme="primary" onclick="document.querySelector('#positioned-dialog').show()">
|
|
24141
24334
|
Open Dialog
|
|
24142
24335
|
</button>
|
|
@@ -24217,113 +24410,93 @@ var combobox_default = {
|
|
|
24217
24410
|
},
|
|
24218
24411
|
examples: [
|
|
24219
24412
|
{
|
|
24220
|
-
title: "
|
|
24221
|
-
code:
|
|
24222
|
-
|
|
24223
|
-
<
|
|
24224
|
-
<
|
|
24225
|
-
<option value="
|
|
24226
|
-
<option value="
|
|
24227
|
-
<option value="
|
|
24228
|
-
</
|
|
24229
|
-
},
|
|
24230
|
-
{
|
|
24231
|
-
title: "React - Multi select",
|
|
24232
|
-
description: 'Use multiselect and displaySelectAll props for multi-select with "Select All" option. Set value prop with array for default selections.',
|
|
24233
|
-
code: `import { Combobox } from '@triptease/react/combobox';
|
|
24234
|
-
|
|
24235
|
-
<label htmlFor="frameworks">Frameworks</label>
|
|
24236
|
-
<Combobox id="frameworks" multiselect displaySelectAll>
|
|
24237
|
-
<option value="react" slot="option">React</option>
|
|
24238
|
-
<option value="vue" slot="option">Vue.js</option>
|
|
24239
|
-
<option value="angular" slot="option">Angular</option>
|
|
24240
|
-
</Combobox>`
|
|
24413
|
+
title: "Basic usage",
|
|
24414
|
+
code: `<label for="channel-single">Booking Channel</label>
|
|
24415
|
+
<tt-combobox id="channel-single">
|
|
24416
|
+
<option value="corporate-travel-agency" slot="option">Corporate Travel Agency</option>
|
|
24417
|
+
<option value="direct-booking" slot="option">Direct Booking</option>
|
|
24418
|
+
<option value="metasearch" slot="option">Metasearch</option>
|
|
24419
|
+
<option value="ota-partner" slot="option">OTA Partner</option>
|
|
24420
|
+
<option value="wholesale" slot="option">Wholesale</option>
|
|
24421
|
+
</tt-combobox>`
|
|
24241
24422
|
},
|
|
24242
24423
|
{
|
|
24243
|
-
title: "
|
|
24244
|
-
description: "
|
|
24245
|
-
code:
|
|
24246
|
-
|
|
24247
|
-
<
|
|
24248
|
-
<
|
|
24249
|
-
<option value="
|
|
24250
|
-
<option value="
|
|
24251
|
-
<option value="ca" slot="option">Canada</option>
|
|
24424
|
+
title: "Disabled option",
|
|
24425
|
+
description: "Use disabled options to keep temporarily unavailable choices visible in the list while preventing their selection. If an option will never be available to this user based on their role or permissions, hide it entirely rather than showing it as disabled.",
|
|
24426
|
+
code: `<label for="channel-option-disabled">Booking Channel</label>
|
|
24427
|
+
<tt-combobox id="channel-option-disabled">
|
|
24428
|
+
<option value="direct-booking" slot="option">Direct Booking</option>
|
|
24429
|
+
<option value="metasearch" slot="option" disabled>Metasearch (Unavailable)</option>
|
|
24430
|
+
<option value="ota-partner" slot="option">OTA Partner</option>
|
|
24431
|
+
<option value="wholesale" slot="option">Wholesale</option>
|
|
24252
24432
|
</tt-combobox>`
|
|
24253
24433
|
},
|
|
24254
24434
|
{
|
|
24255
|
-
title: "
|
|
24256
|
-
description: "Use
|
|
24257
|
-
code:
|
|
24258
|
-
|
|
24259
|
-
<
|
|
24260
|
-
<
|
|
24261
|
-
<
|
|
24262
|
-
<option value="us" slot="option">United States</option>
|
|
24263
|
-
<option value="uk" slot="option">United Kingdom</option>
|
|
24264
|
-
<option value="ca" slot="option">Canada</option>
|
|
24435
|
+
title: "Disabled",
|
|
24436
|
+
description: "Use the disabled state when the field is temporarily unavailable, such as when channel selection is locked during an active campaign. If the field will never be available to this user based on their role or permissions, hide it entirely rather than showing it as disabled.",
|
|
24437
|
+
code: `<label for="channel-disabled">Booking Channel</label>
|
|
24438
|
+
<tt-combobox id="channel-disabled" disabled>
|
|
24439
|
+
<option value="direct-booking" slot="option">Direct Booking</option>
|
|
24440
|
+
<option value="metasearch" slot="option">Metasearch</option>
|
|
24441
|
+
<option value="ota-partner" slot="option">OTA Partner</option>
|
|
24265
24442
|
</tt-combobox>`
|
|
24266
24443
|
},
|
|
24267
24444
|
{
|
|
24268
|
-
title: "
|
|
24269
|
-
description: "Use
|
|
24270
|
-
code:
|
|
24271
|
-
|
|
24272
|
-
<
|
|
24273
|
-
<
|
|
24274
|
-
<option value="
|
|
24275
|
-
<
|
|
24276
|
-
<option value="ca" slot="option">Canada</option>
|
|
24277
|
-
<span slot="error">Please select a valid country</span>
|
|
24445
|
+
title: "Error",
|
|
24446
|
+
description: "Use the error state when a selection is required but missing, or when the current value is invalid. Always include a visible error message.",
|
|
24447
|
+
code: `<label for="channel-error">Booking Channel</label>
|
|
24448
|
+
<tt-combobox id="channel-error" invalid>
|
|
24449
|
+
<option value="direct-booking" slot="option">Direct Booking</option>
|
|
24450
|
+
<option value="metasearch" slot="option">Metasearch</option>
|
|
24451
|
+
<option value="ota-partner" slot="option">OTA Partner</option>
|
|
24452
|
+
<span slot="error">Please select a booking channel</span>
|
|
24278
24453
|
</tt-combobox>`
|
|
24279
24454
|
},
|
|
24280
24455
|
{
|
|
24281
|
-
title: "
|
|
24282
|
-
description:
|
|
24283
|
-
code:
|
|
24284
|
-
|
|
24285
|
-
<form
|
|
24286
|
-
|
|
24287
|
-
|
|
24288
|
-
<option value="
|
|
24289
|
-
<option value="uk" slot="option">United Kingdom</option>
|
|
24290
|
-
<option value="ca" slot="option">Canada</option>
|
|
24456
|
+
title: "In form",
|
|
24457
|
+
description: "Use the name attribute to include the combobox value in HTML form submissions.",
|
|
24458
|
+
code: `<form>
|
|
24459
|
+
<label for="channel-form">Booking Channel</label>
|
|
24460
|
+
<tt-combobox id="channel-form" name="channel" required>
|
|
24461
|
+
<option value="direct-booking" slot="option">Direct Booking</option>
|
|
24462
|
+
<option value="metasearch" slot="option">Metasearch</option>
|
|
24463
|
+
<option value="ota-partner" slot="option">OTA Partner</option>
|
|
24291
24464
|
</tt-combobox>
|
|
24292
|
-
<button type="submit">Submit</button>
|
|
24465
|
+
<button type="submit">Submit Form</button>
|
|
24293
24466
|
</form>`
|
|
24294
24467
|
},
|
|
24295
24468
|
{
|
|
24296
|
-
title: "
|
|
24297
|
-
description: "Use
|
|
24298
|
-
code:
|
|
24299
|
-
|
|
24300
|
-
<
|
|
24301
|
-
<
|
|
24302
|
-
<option value="
|
|
24303
|
-
<option value="
|
|
24304
|
-
<option value="
|
|
24305
|
-
<option value="svelte" slot="option">Svelte</option>
|
|
24469
|
+
title: "Multi-select",
|
|
24470
|
+
description: "Use the multi-select combobox when users need to select more than one option from a list.",
|
|
24471
|
+
code: `<label for="channels-multi">Marketing Channels</label>
|
|
24472
|
+
<tt-combobox id="channels-multi" multiselect>
|
|
24473
|
+
<option value="paid-search" slot="option">Paid Search</option>
|
|
24474
|
+
<option value="metasearch" slot="option">Metasearch</option>
|
|
24475
|
+
<option value="onsite-messages" slot="option">Onsite Messages</option>
|
|
24476
|
+
<option value="email-remarketing" slot="option">Email Remarketing</option>
|
|
24477
|
+
<option value="push-notifications" slot="option">Push Notifications</option>
|
|
24306
24478
|
</tt-combobox>`
|
|
24307
24479
|
},
|
|
24308
24480
|
{
|
|
24309
|
-
title: "
|
|
24310
|
-
description:
|
|
24311
|
-
code:
|
|
24312
|
-
|
|
24313
|
-
<
|
|
24314
|
-
<
|
|
24315
|
-
|
|
24316
|
-
|
|
24317
|
-
|
|
24318
|
-
|
|
24319
|
-
|
|
24320
|
-
|
|
24321
|
-
|
|
24322
|
-
|
|
24323
|
-
|
|
24324
|
-
|
|
24325
|
-
<option value="
|
|
24326
|
-
<option value="
|
|
24481
|
+
title: "Multi-select with select all",
|
|
24482
|
+
description: "Use Select All when users commonly need to select most or all options in the list.",
|
|
24483
|
+
code: `<label for="channels-select-all">Marketing Channels</label>
|
|
24484
|
+
<tt-combobox id="channels-select-all" multiselect display-select-all>
|
|
24485
|
+
<option value="paid-search" slot="option">Paid Search</option>
|
|
24486
|
+
<option value="metasearch" slot="option">Metasearch</option>
|
|
24487
|
+
<option value="onsite-messages" slot="option">Onsite Messages</option>
|
|
24488
|
+
<option value="email-remarketing" slot="option">Email Remarketing</option>
|
|
24489
|
+
<option value="push-notifications" slot="option">Push Notifications</option>
|
|
24490
|
+
</tt-combobox>`
|
|
24491
|
+
},
|
|
24492
|
+
{
|
|
24493
|
+
title: "Open upward",
|
|
24494
|
+
description: "Use the upward-opening dropdown when the combobox is positioned near the bottom of the viewport.",
|
|
24495
|
+
code: `<label for="channel-upward">Booking Channel</label>
|
|
24496
|
+
<tt-combobox id="channel-upward" open-upward>
|
|
24497
|
+
<option value="direct-booking" slot="option">Direct Booking</option>
|
|
24498
|
+
<option value="metasearch" slot="option">Metasearch</option>
|
|
24499
|
+
<option value="ota-partner" slot="option">OTA Partner</option>
|
|
24327
24500
|
</tt-combobox>`
|
|
24328
24501
|
}
|
|
24329
24502
|
]
|
|
@@ -24364,34 +24537,49 @@ var datePicker_default = {
|
|
|
24364
24537
|
},
|
|
24365
24538
|
examples: [
|
|
24366
24539
|
{
|
|
24367
|
-
title: "
|
|
24368
|
-
description: "
|
|
24369
|
-
code:
|
|
24370
|
-
|
|
24371
|
-
<label htmlFor="date">Select a date</label>
|
|
24372
|
-
<DatePicker id="date" />`
|
|
24540
|
+
title: "Basic usage",
|
|
24541
|
+
description: "Date picker for selecting a single date. Value is in ISO format (YYYY-MM-DD). Use mindate and maxdate attributes to restrict selectable dates.",
|
|
24542
|
+
code: `<label for="date-basic">Select a date</label>
|
|
24543
|
+
<tt-date-picker id="date-basic"></tt-date-picker>`
|
|
24373
24544
|
},
|
|
24374
24545
|
{
|
|
24375
|
-
title: "
|
|
24376
|
-
description: "Use
|
|
24377
|
-
code:
|
|
24378
|
-
|
|
24379
|
-
const [selectedDate, setSelectedDate] = useState('');
|
|
24380
|
-
|
|
24381
|
-
<label htmlFor="date">Event date</label>
|
|
24382
|
-
<DatePicker
|
|
24383
|
-
id="date"
|
|
24384
|
-
value={selectedDate}
|
|
24385
|
-
onChange={(e) => setSelectedDate(e.target.value)}
|
|
24386
|
-
/>`
|
|
24546
|
+
title: "With default value",
|
|
24547
|
+
description: "Use the value attribute with ISO date format (YYYY-MM-DD) to pre-select a default date.",
|
|
24548
|
+
code: `<label for="date-default">Departure date</label>
|
|
24549
|
+
<tt-date-picker id="date-default" value="2025-06-15"></tt-date-picker>`
|
|
24387
24550
|
},
|
|
24388
24551
|
{
|
|
24389
|
-
title: "
|
|
24390
|
-
description: "
|
|
24391
|
-
code:
|
|
24392
|
-
|
|
24393
|
-
|
|
24394
|
-
|
|
24552
|
+
title: "With min date",
|
|
24553
|
+
description: "Use the mindate attribute to restrict selectable dates. Dates before the minimum will be disabled in the calendar.",
|
|
24554
|
+
code: `<label for="date-min">Check-in date</label>
|
|
24555
|
+
<tt-date-picker id="date-min" mindate="2025-01-01"></tt-date-picker>`
|
|
24556
|
+
},
|
|
24557
|
+
{
|
|
24558
|
+
title: "With max date",
|
|
24559
|
+
description: "Use the maxdate attribute to restrict selectable dates. Dates after the maximum will be disabled in the calendar.",
|
|
24560
|
+
code: `<label for="date-max">Booking date</label>
|
|
24561
|
+
<tt-date-picker id="date-max" maxdate="2025-12-31"></tt-date-picker>`
|
|
24562
|
+
},
|
|
24563
|
+
{
|
|
24564
|
+
title: "Disabled",
|
|
24565
|
+
description: "Use the disabled state when the date picker is temporarily unavailable, such as when a check-in date has already been confirmed and cannot be changed. If the field will never be available to this user based on their role or permissions, hide it entirely rather than showing it as disabled.",
|
|
24566
|
+
code: `<label for="date-disabled">Event date</label>
|
|
24567
|
+
<tt-date-picker id="date-disabled" value="2025-06-15" disabled></tt-date-picker>`
|
|
24568
|
+
},
|
|
24569
|
+
{
|
|
24570
|
+
title: "Open left",
|
|
24571
|
+
description: "Use the open-left attribute to make the calendar open to the left. Useful for date pickers near the right edge of the viewport.",
|
|
24572
|
+
code: `<label for="date-open-left">Select date</label>
|
|
24573
|
+
<tt-date-picker id="date-open-left" open-left></tt-date-picker>`
|
|
24574
|
+
},
|
|
24575
|
+
{
|
|
24576
|
+
title: "In form",
|
|
24577
|
+
description: "Use the name attribute to include the date picker value in HTML form submissions.",
|
|
24578
|
+
code: `<form>
|
|
24579
|
+
<label for="booking-date">Booking date</label>
|
|
24580
|
+
<tt-date-picker id="booking-date" name="booking-date"></tt-date-picker>
|
|
24581
|
+
<button type="submit">Submit Form</button>
|
|
24582
|
+
</form>`
|
|
24395
24583
|
}
|
|
24396
24584
|
]
|
|
24397
24585
|
}
|
|
@@ -24434,69 +24622,55 @@ var dateRangePicker_default = {
|
|
|
24434
24622
|
},
|
|
24435
24623
|
examples: [
|
|
24436
24624
|
{
|
|
24437
|
-
title: "
|
|
24438
|
-
description: "
|
|
24439
|
-
code:
|
|
24440
|
-
|
|
24441
|
-
<label htmlFor="daterange">Select date range</label>
|
|
24442
|
-
<DateRangePicker id="daterange" />`
|
|
24625
|
+
title: "Basic usage",
|
|
24626
|
+
description: "Date range picker for selecting start and end dates. Dates are in ISO format (YYYY-MM-DD). Use start and end attributes for default values. Use mindate and maxdate attributes to restrict dates.",
|
|
24627
|
+
code: `<label for="daterange-basic">Select date range</label>
|
|
24628
|
+
<tt-date-range-picker id="daterange-basic"></tt-date-range-picker>`
|
|
24443
24629
|
},
|
|
24444
24630
|
{
|
|
24445
|
-
title: "
|
|
24446
|
-
description: "Use
|
|
24447
|
-
code:
|
|
24448
|
-
|
|
24449
|
-
const [startDate, setStartDate] = useState('');
|
|
24450
|
-
const [endDate, setEndDate] = useState('');
|
|
24451
|
-
|
|
24452
|
-
const handleChange = (e) => {
|
|
24453
|
-
const picker = e.target;
|
|
24454
|
-
setStartDate(picker.start || '');
|
|
24455
|
-
setEndDate(picker.end || '');
|
|
24456
|
-
};
|
|
24457
|
-
|
|
24458
|
-
<label htmlFor="daterange">Booking dates</label>
|
|
24459
|
-
<DateRangePicker id="daterange" start={startDate} end={endDate} onChange={handleChange} />`
|
|
24631
|
+
title: "With default value",
|
|
24632
|
+
description: "Use the start and end attributes with ISO date format (YYYY-MM-DD) to pre-select a date range.",
|
|
24633
|
+
code: `<label for="daterange-default">Travel dates</label>
|
|
24634
|
+
<tt-date-range-picker id="daterange-default" start="2025-06-15" end="2025-06-22"></tt-date-range-picker>`
|
|
24460
24635
|
},
|
|
24461
24636
|
{
|
|
24462
|
-
title: "
|
|
24463
|
-
description:
|
|
24464
|
-
code:
|
|
24465
|
-
|
|
24466
|
-
<label htmlFor="daterange">Travel dates</label>
|
|
24467
|
-
<DateRangePicker id="daterange">
|
|
24468
|
-
<PresetButton slot="preset" preset={Preset.ThisWeek}>This Week</PresetButton>
|
|
24469
|
-
<PresetButton slot="preset" preset={Preset.ThisMonth}>This Month</PresetButton>
|
|
24470
|
-
<PresetButton slot="preset" preset={Preset.Next1Month}>Next Month</PresetButton>
|
|
24471
|
-
</DateRangePicker>`
|
|
24637
|
+
title: "With min date",
|
|
24638
|
+
description: "Use the mindate attribute to prevent selecting dates before a certain date.",
|
|
24639
|
+
code: `<label for="daterange-min">Booking dates</label>
|
|
24640
|
+
<tt-date-range-picker id="daterange-min" mindate="2025-01-01"></tt-date-range-picker>`
|
|
24472
24641
|
},
|
|
24473
24642
|
{
|
|
24474
|
-
title: "
|
|
24475
|
-
description: "
|
|
24476
|
-
code:
|
|
24477
|
-
|
|
24478
|
-
<label for="daterange">Select date range</label>
|
|
24479
|
-
<tt-date-range-picker id="daterange"></tt-date-range-picker>`
|
|
24643
|
+
title: "With max date",
|
|
24644
|
+
description: "Use the maxdate attribute to prevent selecting dates after a certain date.",
|
|
24645
|
+
code: `<label for="daterange-max">Booking dates</label>
|
|
24646
|
+
<tt-date-range-picker id="daterange-max" maxdate="2025-12-31"></tt-date-range-picker>`
|
|
24480
24647
|
},
|
|
24481
24648
|
{
|
|
24482
|
-
title: "
|
|
24483
|
-
description:
|
|
24484
|
-
code:
|
|
24485
|
-
|
|
24486
|
-
|
|
24649
|
+
title: "Disabled",
|
|
24650
|
+
description: "Use the disabled state when the date range picker is temporarily unavailable, such as when a booking window has been locked pending confirmation. If the field will never be available to this user based on their role or permissions, hide it entirely rather than showing it as disabled.",
|
|
24651
|
+
code: `<label for="daterange-disabled">Event dates</label>
|
|
24652
|
+
<tt-date-range-picker id="daterange-disabled" start="2025-06-15" end="2025-06-22" disabled></tt-date-range-picker>`
|
|
24653
|
+
},
|
|
24654
|
+
{
|
|
24655
|
+
title: "Open left",
|
|
24656
|
+
description: "Use the open-left attribute to make the calendar open to the left. Useful for pickers near the right edge of the viewport.",
|
|
24657
|
+
code: `<label for="daterange-openleft">Select dates</label>
|
|
24658
|
+
<tt-date-range-picker id="daterange-openleft" open-left></tt-date-range-picker>`
|
|
24659
|
+
},
|
|
24660
|
+
{
|
|
24661
|
+
title: "In form",
|
|
24662
|
+
description: "Use the name attribute to include the date range value in HTML form submissions. The form value is a JSON string with startDate and endDate keys.",
|
|
24663
|
+
code: `<form>
|
|
24487
24664
|
<label for="booking-dates">Booking dates</label>
|
|
24488
24665
|
<tt-date-range-picker id="booking-dates" name="booking-dates"></tt-date-range-picker>
|
|
24489
24666
|
<button type="submit">Submit</button>
|
|
24490
24667
|
</form>`
|
|
24491
24668
|
},
|
|
24492
24669
|
{
|
|
24493
|
-
title: "
|
|
24494
|
-
description:
|
|
24495
|
-
code:
|
|
24496
|
-
|
|
24497
|
-
|
|
24498
|
-
<label for="daterange">Travel dates</label>
|
|
24499
|
-
<tt-date-range-picker id="daterange">
|
|
24670
|
+
title: "With presets",
|
|
24671
|
+
description: 'Use tt-preset-button elements for quick date range selection. Place them inside tt-date-range-picker with slot="preset".',
|
|
24672
|
+
code: `<label for="daterange-presets">Travel dates</label>
|
|
24673
|
+
<tt-date-range-picker id="daterange-presets">
|
|
24500
24674
|
<tt-preset-button slot="preset" preset="this-week">This Week</tt-preset-button>
|
|
24501
24675
|
<tt-preset-button slot="preset" preset="next-week">Next Week</tt-preset-button>
|
|
24502
24676
|
<tt-preset-button slot="preset" preset="this-month">This Month</tt-preset-button>
|
|
@@ -24603,32 +24777,128 @@ var barChart_default = {
|
|
|
24603
24777
|
},
|
|
24604
24778
|
examples: [
|
|
24605
24779
|
{
|
|
24606
|
-
title: "Basic
|
|
24607
|
-
code:
|
|
24608
|
-
|
|
24609
|
-
|
|
24610
|
-
|
|
24611
|
-
<tt-
|
|
24780
|
+
title: "Basic usage",
|
|
24781
|
+
code: `<tt-bar-chart id="basic-bar-chart">
|
|
24782
|
+
<tt-dataset label="2024">
|
|
24783
|
+
<tt-data-point label="Total Opens" value="2600"></tt-data-point>
|
|
24784
|
+
<tt-data-point label="Total Clicks" value="355"></tt-data-point>
|
|
24785
|
+
<tt-data-point label="Bookings" value="76"></tt-data-point>
|
|
24786
|
+
</tt-dataset>
|
|
24787
|
+
</tt-bar-chart>`
|
|
24788
|
+
},
|
|
24789
|
+
{
|
|
24790
|
+
title: "Custom size",
|
|
24791
|
+
description: "Use when the chart needs a fixed size rather than filling its container. Both width and height accept any valid CSS measurement. If neither is provided, the chart defaults to 100% and fills its container.",
|
|
24792
|
+
code: `<tt-bar-chart id="custom-size-bar-chart" width="30rem" height="10rem">
|
|
24793
|
+
<tt-dataset label="2024">
|
|
24794
|
+
<tt-data-point label="Total Opens" value="2600"></tt-data-point>
|
|
24795
|
+
<tt-data-point label="Total Clicks" value="355"></tt-data-point>
|
|
24796
|
+
<tt-data-point label="Bookings" value="76"></tt-data-point>
|
|
24797
|
+
</tt-dataset>
|
|
24798
|
+
</tt-bar-chart>`
|
|
24799
|
+
},
|
|
24800
|
+
{
|
|
24801
|
+
title: "Axis titles",
|
|
24802
|
+
description: "Use axis titles to clarify what the chart displays, particularly units of measurement. Keep titles concise to avoid cluttering the chart. Avoid duplicating information that is already visible elsewhere on the page.",
|
|
24803
|
+
code: `<tt-bar-chart id="axis-titles-bar-chart" x-axis-title="Count" y-axis-title="Interaction Type" height="20rem">
|
|
24804
|
+
<tt-dataset label="2024">
|
|
24805
|
+
<tt-data-point label="Total Opens" value="2600"></tt-data-point>
|
|
24806
|
+
<tt-data-point label="Total Clicks" value="355"></tt-data-point>
|
|
24807
|
+
<tt-data-point label="Bookings" value="76"></tt-data-point>
|
|
24808
|
+
</tt-dataset>
|
|
24809
|
+
</tt-bar-chart>`
|
|
24810
|
+
},
|
|
24811
|
+
{
|
|
24812
|
+
title: "Vertical",
|
|
24813
|
+
description: "Use vertical bar charts for time series data. Do not use when the intended purpose is to visualize long, continuous trends \u2014 use a line or area chart instead.",
|
|
24814
|
+
code: `<tt-bar-chart id="vertical-bar-chart" direction="vertical" height="20rem">
|
|
24815
|
+
<tt-dataset label="2024">
|
|
24816
|
+
<tt-data-point label="Monday" value="3424"></tt-data-point>
|
|
24817
|
+
<tt-data-point label="Tuesday" value="3401"></tt-data-point>
|
|
24818
|
+
<tt-data-point label="Wednesday" value="7201"></tt-data-point>
|
|
24819
|
+
<tt-data-point label="Thursday" value="5301"></tt-data-point>
|
|
24820
|
+
<tt-data-point label="Friday" value="492"></tt-data-point>
|
|
24821
|
+
<tt-data-point label="Saturday" value="235"></tt-data-point>
|
|
24822
|
+
<tt-data-point label="Sunday" value="3941"></tt-data-point>
|
|
24823
|
+
</tt-dataset>
|
|
24824
|
+
</tt-bar-chart>`
|
|
24825
|
+
},
|
|
24826
|
+
{
|
|
24827
|
+
title: "Value prefix",
|
|
24828
|
+
description: "Use a value prefix when the unit of measurement appears before the number, such as a currency symbol.",
|
|
24829
|
+
code: `<tt-bar-chart id="value-prefix-bar-chart" height="20rem" value-prefix="\xA3">
|
|
24830
|
+
<tt-dataset label="2024">
|
|
24831
|
+
<tt-data-point label="Monday" value="3424"></tt-data-point>
|
|
24832
|
+
<tt-data-point label="Tuesday" value="3401"></tt-data-point>
|
|
24833
|
+
<tt-data-point label="Wednesday" value="7201"></tt-data-point>
|
|
24834
|
+
<tt-data-point label="Thursday" value="5301"></tt-data-point>
|
|
24835
|
+
<tt-data-point label="Friday" value="492"></tt-data-point>
|
|
24836
|
+
<tt-data-point label="Saturday" value="235"></tt-data-point>
|
|
24837
|
+
<tt-data-point label="Sunday" value="3941"></tt-data-point>
|
|
24838
|
+
</tt-dataset>
|
|
24839
|
+
</tt-bar-chart>`
|
|
24840
|
+
},
|
|
24841
|
+
{
|
|
24842
|
+
title: "Value suffix",
|
|
24843
|
+
description: "Use a value suffix when the unit of measurement appears after the number, such as a percentage, a distance, or any other labelled unit.",
|
|
24844
|
+
code: `<tt-bar-chart id="value-suffix-bar-chart" height="20rem" value-suffix="%">
|
|
24612
24845
|
<tt-dataset label="2024">
|
|
24613
|
-
<tt-data-point label="
|
|
24614
|
-
<tt-data-point label="
|
|
24615
|
-
<tt-data-point label="
|
|
24846
|
+
<tt-data-point label="Monday" value="31"></tt-data-point>
|
|
24847
|
+
<tt-data-point label="Tuesday" value="85"></tt-data-point>
|
|
24848
|
+
<tt-data-point label="Wednesday" value="10"></tt-data-point>
|
|
24849
|
+
<tt-data-point label="Thursday" value="3"></tt-data-point>
|
|
24850
|
+
<tt-data-point label="Friday" value="15"></tt-data-point>
|
|
24851
|
+
<tt-data-point label="Saturday" value="47"></tt-data-point>
|
|
24852
|
+
<tt-data-point label="Sunday" value="62"></tt-data-point>
|
|
24853
|
+
</tt-dataset>
|
|
24854
|
+
</tt-bar-chart>`
|
|
24855
|
+
},
|
|
24856
|
+
{
|
|
24857
|
+
title: "Stacked",
|
|
24858
|
+
description: "Use stacked bar charts when displaying datasets whose values contribute to a meaningful total. Limit datasets to a maximum of 6, as more datasets make the chart difficult to read and compare. Avoid using stacked bar charts when one segment is significantly larger than the others, as users will struggle to identify and compare smaller segments. Keep in mind that comparing segments in the middle of the bar is difficult because they do not start at zero.",
|
|
24859
|
+
code: `<tt-bar-chart id="stacked-bar-chart" direction="vertical" y-axis-title="Total Bookings" stacked height="30rem">
|
|
24860
|
+
<tt-dataset label="Messages">
|
|
24861
|
+
<tt-data-point label="January" value="7"></tt-data-point>
|
|
24862
|
+
<tt-data-point label="February" value="4"></tt-data-point>
|
|
24863
|
+
<tt-data-point label="March" value="2"></tt-data-point>
|
|
24864
|
+
</tt-dataset>
|
|
24865
|
+
<tt-dataset label="Metasearch">
|
|
24866
|
+
<tt-data-point label="January" value="2"></tt-data-point>
|
|
24867
|
+
<tt-data-point label="February" value="3"></tt-data-point>
|
|
24868
|
+
<tt-data-point label="March" value="8"></tt-data-point>
|
|
24869
|
+
</tt-dataset>
|
|
24870
|
+
<tt-dataset label="Paid Search">
|
|
24871
|
+
<tt-data-point label="January" value="3"></tt-data-point>
|
|
24872
|
+
<tt-data-point label="February" value="2"></tt-data-point>
|
|
24873
|
+
<tt-data-point label="March" value="4"></tt-data-point>
|
|
24616
24874
|
</tt-dataset>
|
|
24617
24875
|
</tt-bar-chart>`
|
|
24618
24876
|
},
|
|
24619
24877
|
{
|
|
24620
24878
|
title: "Multiple datasets",
|
|
24621
24879
|
description: "Use multiple datasets to compare the same categories across different groups or time periods. Limit datasets to a maximum of 6, as more datasets make the chart difficult to read and compare.",
|
|
24622
|
-
code: `<tt-bar-chart id="multiple-datasets-chart" height="30rem">
|
|
24880
|
+
code: `<tt-bar-chart id="multiple-datasets-bar-chart" height="30rem">
|
|
24623
24881
|
<tt-dataset label="2024">
|
|
24624
|
-
<tt-data-point label="Total Bookings" value=
|
|
24625
|
-
<tt-data-point label="Total Clicks" value=
|
|
24882
|
+
<tt-data-point label="Total Bookings" value="7"></tt-data-point>
|
|
24883
|
+
<tt-data-point label="Total Clicks" value="4"></tt-data-point>
|
|
24884
|
+
<tt-data-point label="Total Opens" value="2"></tt-data-point>
|
|
24626
24885
|
</tt-dataset>
|
|
24627
24886
|
<tt-dataset label="2025">
|
|
24628
|
-
<tt-data-point label="Total Bookings" value=
|
|
24629
|
-
<tt-data-point label="Total Clicks" value=
|
|
24887
|
+
<tt-data-point label="Total Bookings" value="2"></tt-data-point>
|
|
24888
|
+
<tt-data-point label="Total Clicks" value="3"></tt-data-point>
|
|
24889
|
+
<tt-data-point label="Total Opens" value="8"></tt-data-point>
|
|
24890
|
+
</tt-dataset>
|
|
24891
|
+
<tt-dataset label="2026">
|
|
24892
|
+
<tt-data-point label="Total Bookings" value="3"></tt-data-point>
|
|
24893
|
+
<tt-data-point label="Total Clicks" value="2"></tt-data-point>
|
|
24894
|
+
<tt-data-point label="Total Opens" value="4"></tt-data-point>
|
|
24630
24895
|
</tt-dataset>
|
|
24631
24896
|
</tt-bar-chart>`
|
|
24897
|
+
},
|
|
24898
|
+
{
|
|
24899
|
+
title: "Loading",
|
|
24900
|
+
description: "Use the loading state while chart data is being fetched or processed. Do not manually set aria-busy, as the component handles this automatically. The loading state automatically reflects the chart direction attribute.",
|
|
24901
|
+
code: `<tt-bar-chart id="loading-bar-chart" loading></tt-bar-chart>`
|
|
24632
24902
|
}
|
|
24633
24903
|
]
|
|
24634
24904
|
}
|
|
@@ -24742,58 +25012,98 @@ var lineChart_default = {
|
|
|
24742
25012
|
},
|
|
24743
25013
|
examples: [
|
|
24744
25014
|
{
|
|
24745
|
-
title: "Basic
|
|
24746
|
-
code:
|
|
24747
|
-
import '@triptease/tt-dataset';
|
|
24748
|
-
import '@triptease/tt-data-point';
|
|
24749
|
-
|
|
24750
|
-
<tt-line-chart id="basic-chart">
|
|
25015
|
+
title: "Basic usage",
|
|
25016
|
+
code: `<tt-line-chart id="basic-line-chart">
|
|
24751
25017
|
<tt-dataset label="2024">
|
|
24752
|
-
<tt-data-point label="Jan 1" value=
|
|
24753
|
-
<tt-data-point label="Jan 2" value=
|
|
24754
|
-
<tt-data-point label="Jan 3" value=
|
|
25018
|
+
<tt-data-point label="Jan 1" value="45"></tt-data-point>
|
|
25019
|
+
<tt-data-point label="Jan 2" value="47"></tt-data-point>
|
|
25020
|
+
<tt-data-point label="Jan 3" value="44"></tt-data-point>
|
|
25021
|
+
<tt-data-point label="Jan 4" value="50"></tt-data-point>
|
|
25022
|
+
<tt-data-point label="Jan 5" value="52"></tt-data-point>
|
|
25023
|
+
</tt-dataset>
|
|
25024
|
+
</tt-line-chart>`
|
|
25025
|
+
},
|
|
25026
|
+
{
|
|
25027
|
+
title: "Custom size",
|
|
25028
|
+
description: "Use when the chart needs a fixed size rather than filling its container. Both width and height accept any valid CSS measurement. If neither is provided, the chart defaults to 100% and fills its container.",
|
|
25029
|
+
code: `<tt-line-chart id="custom-size-line-chart" width="30rem" height="10rem">
|
|
25030
|
+
<tt-dataset label="2024">
|
|
25031
|
+
<tt-data-point label="Jan 1" value="45"></tt-data-point>
|
|
25032
|
+
<tt-data-point label="Jan 2" value="47"></tt-data-point>
|
|
25033
|
+
<tt-data-point label="Jan 3" value="44"></tt-data-point>
|
|
25034
|
+
</tt-dataset>
|
|
25035
|
+
</tt-line-chart>`
|
|
25036
|
+
},
|
|
25037
|
+
{
|
|
25038
|
+
title: "Loading",
|
|
25039
|
+
description: "Use the loading state while chart data is being fetched or processed. Do not manually set aria-busy, as the component handles this automatically.",
|
|
25040
|
+
code: `<tt-line-chart id="loading-line-chart" loading height="20rem"></tt-line-chart>`
|
|
25041
|
+
},
|
|
25042
|
+
{
|
|
25043
|
+
title: "Axis titles",
|
|
25044
|
+
description: "Use axis titles to clarify what the chart displays, particularly units of measurement. Keep titles concise to avoid cluttering the chart. Avoid duplicating information that is already visible elsewhere on the page.",
|
|
25045
|
+
code: `<tt-line-chart id="axis-titles-line-chart" x-axis-title="Date" y-axis-title="Number of Sessions" height="20rem">
|
|
25046
|
+
<tt-dataset label="2024">
|
|
25047
|
+
<tt-data-point label="Jan 1" value="45"></tt-data-point>
|
|
25048
|
+
<tt-data-point label="Jan 2" value="47"></tt-data-point>
|
|
25049
|
+
<tt-data-point label="Jan 3" value="44"></tt-data-point>
|
|
24755
25050
|
</tt-dataset>
|
|
24756
25051
|
</tt-line-chart>`
|
|
24757
25052
|
},
|
|
24758
25053
|
{
|
|
24759
25054
|
title: "Multiple datasets",
|
|
24760
25055
|
description: "Use multiple datasets to compare trends of the same measure for different groups. Limit datasets to a maximum of 4, as more datasets make the chart difficult to read and compare. The component automatically uses symbols to help identify each dataset without relying on color.",
|
|
24761
|
-
code: `<tt-line-chart id="multiple-datasets" height="20rem">
|
|
25056
|
+
code: `<tt-line-chart id="multiple-datasets-line-chart" y-axis-title="Number of Sessions" height="20rem">
|
|
24762
25057
|
<tt-dataset label="2025">
|
|
24763
|
-
<tt-data-point label="Jan 1" value=
|
|
24764
|
-
<tt-data-point label="Jan 2" value=
|
|
25058
|
+
<tt-data-point label="Jan 1" value="52"></tt-data-point>
|
|
25059
|
+
<tt-data-point label="Jan 2" value="54"></tt-data-point>
|
|
25060
|
+
<tt-data-point label="Jan 3" value="51"></tt-data-point>
|
|
24765
25061
|
</tt-dataset>
|
|
24766
25062
|
<tt-dataset label="2024">
|
|
24767
|
-
<tt-data-point label="Jan 1" value=
|
|
24768
|
-
<tt-data-point label="Jan 2" value=
|
|
25063
|
+
<tt-data-point label="Jan 1" value="45"></tt-data-point>
|
|
25064
|
+
<tt-data-point label="Jan 2" value="47"></tt-data-point>
|
|
25065
|
+
<tt-data-point label="Jan 3" value="44"></tt-data-point>
|
|
24769
25066
|
</tt-dataset>
|
|
24770
25067
|
</tt-line-chart>`
|
|
24771
25068
|
},
|
|
24772
25069
|
{
|
|
24773
|
-
title: "
|
|
25070
|
+
title: "Highlighted regions",
|
|
24774
25071
|
description: "Use highlighted regions to draw attention to and label significant intervals. Only use when something significant occurs that may have affected the data. Use sparingly and highlight only the most important intervals to avoid clutter. Avoid overlapping regions as this can make it difficult to see where each interval starts and ends. Do not use when displaying multiple datasets if the highlight applies to only one dataset, as users may assume it applies to all.",
|
|
24775
|
-
code:
|
|
24776
|
-
|
|
24777
|
-
<tt-line-chart id="highlighted-chart" height="20rem">
|
|
25072
|
+
code: `<tt-line-chart id="highlighted-line-chart" height="20rem">
|
|
24778
25073
|
<tt-dataset label="2025">
|
|
24779
|
-
<tt-data-point label="Jan 1" value=
|
|
24780
|
-
<tt-data-point label="
|
|
25074
|
+
<tt-data-point label="Jan 1" value="45"></tt-data-point>
|
|
25075
|
+
<tt-data-point label="Apr 1" value="68"></tt-data-point>
|
|
25076
|
+
<tt-data-point label="Aug 1" value="72"></tt-data-point>
|
|
25077
|
+
<tt-data-point label="Dec 31" value="58"></tt-data-point>
|
|
24781
25078
|
</tt-dataset>
|
|
24782
25079
|
<tt-highlight label="Easter Boost" from="15 Mar" to="5 Apr"></tt-highlight>
|
|
24783
|
-
|
|
25080
|
+
<tt-highlight label="Summer Boost" from="1 Jul" to="31 Aug"></tt-highlight>
|
|
25081
|
+
</tt-line-chart>`
|
|
24784
25082
|
},
|
|
24785
25083
|
{
|
|
24786
|
-
title: "
|
|
24787
|
-
description: "
|
|
24788
|
-
code:
|
|
24789
|
-
|
|
24790
|
-
<tt-line-chart id="highlighted-chart" height="20rem">
|
|
25084
|
+
title: "Hide numbers",
|
|
25085
|
+
description: "Hide numbers when they obscure the overall trend or could lead users to misunderstand the purpose of the chart. Use sparingly, as numbers generally help users understand the scale of the data. This option removes y-axis numbers, disables tooltips, and disables automatic ARIA label generation. Provide a description of the general trend so non-visual users can understand the chart.",
|
|
25086
|
+
code: `<tt-line-chart id="hide-numbers-line-chart" hide-numbers height="20rem">
|
|
24791
25087
|
<tt-dataset label="2025">
|
|
24792
|
-
<tt-data-point label="Jan 1" value=
|
|
24793
|
-
<tt-data-point label="Jan 2" value=
|
|
25088
|
+
<tt-data-point label="Jan 1" value="45"></tt-data-point>
|
|
25089
|
+
<tt-data-point label="Jan 2" value="47"></tt-data-point>
|
|
25090
|
+
<tt-data-point label="Jan 3" value="44"></tt-data-point>
|
|
24794
25091
|
</tt-dataset>
|
|
24795
|
-
|
|
24796
|
-
|
|
25092
|
+
</tt-line-chart>`
|
|
25093
|
+
},
|
|
25094
|
+
{
|
|
25095
|
+
title: "Milestones",
|
|
25096
|
+
description: "Use milestones to draw attention to and label significant points in time on a chart. Only use when something significant occurred that may have affected the data, or to mark an important point in time such as today, start, or finish. Use sparingly and highlight only the most important events to avoid clutter. Avoid positioning milestones too close together as labels may overlap and become difficult to read. Do not use when displaying multiple datasets if the milestone applies to only one dataset, as users may assume it applies to all.",
|
|
25097
|
+
code: `<tt-line-chart id="milestones-line-chart" height="20rem">
|
|
25098
|
+
<tt-dataset label="2025">
|
|
25099
|
+
<tt-data-point label="Jan 1" value="45"></tt-data-point>
|
|
25100
|
+
<tt-data-point label="Feb 18" value="52"></tt-data-point>
|
|
25101
|
+
<tt-data-point label="Aug 5" value="61"></tt-data-point>
|
|
25102
|
+
<tt-data-point label="Dec 31" value="58"></tt-data-point>
|
|
25103
|
+
</tt-dataset>
|
|
25104
|
+
<tt-milestone label="Today" value="Feb 18"></tt-milestone>
|
|
25105
|
+
<tt-milestone label="Campaign Start" value="Aug 5"></tt-milestone>
|
|
25106
|
+
</tt-line-chart>`
|
|
24797
25107
|
}
|
|
24798
25108
|
]
|
|
24799
25109
|
}
|
|
@@ -24803,7 +25113,7 @@ import '@triptease/tt-data-point';
|
|
|
24803
25113
|
var statistic_default = {
|
|
24804
25114
|
statistic: {
|
|
24805
25115
|
name: "Statistic",
|
|
24806
|
-
description: "
|
|
25116
|
+
description: "Surfaces key metrics as a labelled value, optionally paired with a status indicator or contextual note.",
|
|
24807
25117
|
element: "div",
|
|
24808
25118
|
usageGuidance: {
|
|
24809
25119
|
whenToUse: [
|
|
@@ -24820,7 +25130,7 @@ var statistic_default = {
|
|
|
24820
25130
|
},
|
|
24821
25131
|
examples: [
|
|
24822
25132
|
{
|
|
24823
|
-
title: "Basic
|
|
25133
|
+
title: "Basic usage",
|
|
24824
25134
|
code: `
|
|
24825
25135
|
<div class="card">
|
|
24826
25136
|
<div class="statistic">
|
|
@@ -24884,7 +25194,7 @@ var banner_default = {
|
|
|
24884
25194
|
"To display non-important information that does not require the users' immediate attention.",
|
|
24885
25195
|
"To advertise new features, services or updates.",
|
|
24886
25196
|
"To display form validation errors (place an error message beneath, or as close as is possible to, the input instead).",
|
|
24887
|
-
"To display lengthy information (consider a dialog or put the information on a separate page and use a banner to draw the users' attention to it instead).
|
|
25197
|
+
"To display lengthy information (consider a dialog or put the information on a separate page and use a banner to draw the users' attention to it instead)."
|
|
24888
25198
|
]
|
|
24889
25199
|
},
|
|
24890
25200
|
dataAttributes: {
|
|
@@ -24897,42 +25207,41 @@ var banner_default = {
|
|
|
24897
25207
|
examples: [
|
|
24898
25208
|
{
|
|
24899
25209
|
title: "Basic usage",
|
|
24900
|
-
code:
|
|
24901
|
-
|
|
24902
|
-
|
|
24903
|
-
</div>`
|
|
25210
|
+
code: `<div class="banner">
|
|
25211
|
+
<p class="banner--body">Your metasearch bids have been updated successfully.</p>
|
|
25212
|
+
</div>`
|
|
24904
25213
|
},
|
|
24905
25214
|
{
|
|
24906
25215
|
title: "With title",
|
|
24907
|
-
|
|
24908
|
-
|
|
24909
|
-
|
|
24910
|
-
|
|
24911
|
-
|
|
25216
|
+
description: "Use a title to give the banner a clear heading when the message benefits from a short summary line.",
|
|
25217
|
+
code: `<div class="banner">
|
|
25218
|
+
<p class="banner--title">Rate parity issue detected</p>
|
|
25219
|
+
<p class="banner--body">One or more OTA channels are undercutting your direct rate.</p>
|
|
25220
|
+
</div>`
|
|
24912
25221
|
},
|
|
24913
25222
|
{
|
|
24914
|
-
title: "With
|
|
24915
|
-
|
|
24916
|
-
|
|
24917
|
-
|
|
24918
|
-
|
|
24919
|
-
|
|
24920
|
-
|
|
24921
|
-
|
|
25223
|
+
title: "With action",
|
|
25224
|
+
description: "Use an action to give users a clear next step \u2014 for example, a close button to dismiss the banner, a link to a relevant page, or a button to open a dialog.",
|
|
25225
|
+
code: `<div class="banner">
|
|
25226
|
+
<p class="banner--body">Your metasearch bids have been updated successfully.</p>
|
|
25227
|
+
<button class="banner--action small" data-theme="tertiary">
|
|
25228
|
+
<tt-icon name="close" label="Close"></tt-icon>
|
|
25229
|
+
</button>
|
|
25230
|
+
</div>`
|
|
24922
25231
|
},
|
|
24923
25232
|
{
|
|
24924
25233
|
title: "Warning",
|
|
24925
|
-
|
|
24926
|
-
|
|
24927
|
-
|
|
24928
|
-
|
|
25234
|
+
description: "Use the warning theme for situations that may require attention but are not yet critical, such as low occupancy in the next 14 days.",
|
|
25235
|
+
code: `<div class="banner" data-theme="warning">
|
|
25236
|
+
<p class="banner--body">Occupancy for the next 14 days is below 40%.</p>
|
|
25237
|
+
</div>`
|
|
24929
25238
|
},
|
|
24930
25239
|
{
|
|
24931
25240
|
title: "Alert",
|
|
24932
|
-
|
|
24933
|
-
|
|
24934
|
-
|
|
24935
|
-
|
|
25241
|
+
description: "Use the alert theme for urgent messages that require immediate action, such as a channel connectivity failure.",
|
|
25242
|
+
code: `<div class="banner" data-theme="alert">
|
|
25243
|
+
<p class="banner--body">Channel connection lost. Rates are not being distributed.</p>
|
|
25244
|
+
</div>`
|
|
24936
25245
|
}
|
|
24937
25246
|
]
|
|
24938
25247
|
}
|
|
@@ -24998,9 +25307,7 @@ var tabs_default = {
|
|
|
24998
25307
|
examples: [
|
|
24999
25308
|
{
|
|
25000
25309
|
title: "Basic usage",
|
|
25001
|
-
code:
|
|
25002
|
-
|
|
25003
|
-
<tt-tabs>
|
|
25310
|
+
code: `<tt-tabs>
|
|
25004
25311
|
<tt-tab-pane name="Tab One">
|
|
25005
25312
|
<p>Tab one content.</p>
|
|
25006
25313
|
</tt-tab-pane>
|
|
@@ -25061,24 +25368,21 @@ var paginator_default = {
|
|
|
25061
25368
|
element: "tt-paginator",
|
|
25062
25369
|
usageGuidance: {
|
|
25063
25370
|
whenToUse: [
|
|
25064
|
-
"
|
|
25065
|
-
"
|
|
25066
|
-
|
|
25371
|
+
"Lists, grids, or tables with more than 25 items",
|
|
25372
|
+
"When the consumer controls data fetching and needs to know which page to display"
|
|
25373
|
+
],
|
|
25374
|
+
avoid: [
|
|
25375
|
+
"Datasets with 25 or fewer items \u2014 display them all on a single page instead. The paginator hides itself automatically when all items fit on a single page, so no extra visibility logic is needed. The default page-size is 25, so you can omit the attribute if that fits your use case.",
|
|
25376
|
+
"Infinite scroll or load more patterns"
|
|
25067
25377
|
],
|
|
25068
25378
|
bestPractices: [
|
|
25069
|
-
"
|
|
25070
|
-
"Listen for the page-change event to fetch or display the correct page of data",
|
|
25071
|
-
"The component auto-hides when there is only one page or fewer"
|
|
25379
|
+
"Place the paginator immediately after the content it controls \u2014 no extra spacing or positioning needed. The component handles its own top margin and alignment."
|
|
25072
25380
|
],
|
|
25073
25381
|
accessibility: [
|
|
25074
|
-
|
|
25075
|
-
'
|
|
25076
|
-
|
|
25077
|
-
|
|
25078
|
-
avoid: [
|
|
25079
|
-
"When the dataset is small enough to display without pagination",
|
|
25080
|
-
"For infinite scroll patterns (use intersection observers instead)",
|
|
25081
|
-
"Prefer tt-table-wrapper when paginating a table, as it embeds tt-paginator automatically"
|
|
25382
|
+
'The component uses role="navigation" with aria-label="Pagination"',
|
|
25383
|
+
'Page buttons include aria-label="Go to page N" and aria-current="page" for the active page',
|
|
25384
|
+
"Keyboard navigation: Arrow keys move between buttons, Home/End jump to first/last",
|
|
25385
|
+
"First/Previous/Next/Last buttons are disabled (not hidden) when at boundaries"
|
|
25082
25386
|
]
|
|
25083
25387
|
},
|
|
25084
25388
|
installationOptions: {
|
|
@@ -25104,7 +25408,7 @@ var paginator_default = {
|
|
|
25104
25408
|
},
|
|
25105
25409
|
"page-size": {
|
|
25106
25410
|
type: "number",
|
|
25107
|
-
default: "
|
|
25411
|
+
default: "25",
|
|
25108
25412
|
description: "Number of rows per page."
|
|
25109
25413
|
}
|
|
25110
25414
|
},
|
|
@@ -25118,12 +25422,38 @@ var paginator_default = {
|
|
|
25118
25422
|
examples: [
|
|
25119
25423
|
{
|
|
25120
25424
|
title: "Basic usage",
|
|
25121
|
-
code: `<
|
|
25425
|
+
code: `<div>
|
|
25426
|
+
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-scale-3);">
|
|
25427
|
+
<div class="card" style="padding: 0; overflow: hidden;">
|
|
25428
|
+
<div style="background: var(--color-primary-200); padding: var(--space-scale-3);">
|
|
25429
|
+
<p class="small">Book Direct & Save</p>
|
|
25430
|
+
<p class="strong">Best rate guaranteed</p>
|
|
25431
|
+
<p class="small">Book directly with us and get our lowest available rate \u2014 no booking fees, no middlemen.</p>
|
|
25432
|
+
</div>
|
|
25433
|
+
<div style="display: flex; justify-content: space-between; align-items: center; padding: 0 var(--space-scale-3) var(--space-scale-3);">
|
|
25434
|
+
<span class="badge" data-theme="info">Onsite</span>
|
|
25435
|
+
<button data-theme="secondary">Use template</button>
|
|
25436
|
+
</div>
|
|
25437
|
+
</div>
|
|
25438
|
+
<div class="card" style="padding: 0; overflow: hidden;">
|
|
25439
|
+
<div style="background: var(--color-primary-200); padding: var(--space-scale-3);">
|
|
25440
|
+
<p class="small">Members Only Rate</p>
|
|
25441
|
+
<p class="strong">Exclusive rate for members</p>
|
|
25442
|
+
<p class="small">Sign in to unlock a loyalty rate available only to members. Up to 15% off.</p>
|
|
25443
|
+
</div>
|
|
25444
|
+
<div style="display: flex; justify-content: space-between; align-items: center; padding: 0 var(--space-scale-3) var(--space-scale-3);">
|
|
25445
|
+
<span class="badge" data-theme="info">Onsite</span>
|
|
25446
|
+
<button data-theme="secondary">Use template</button>
|
|
25447
|
+
</div>
|
|
25448
|
+
</div>
|
|
25449
|
+
</div>
|
|
25450
|
+
<tt-paginator total-rows="12" page-size="6"></tt-paginator>
|
|
25451
|
+
</div>
|
|
25122
25452
|
|
|
25123
25453
|
<script>
|
|
25124
25454
|
document.querySelector('tt-paginator')
|
|
25125
25455
|
.addEventListener('page-change', (e) => {
|
|
25126
|
-
|
|
25456
|
+
// fetch or slice items for e.detail.page and re-render the grid
|
|
25127
25457
|
});
|
|
25128
25458
|
</script>`
|
|
25129
25459
|
}
|